centos上配置go开发环境

.vimrc配置

1
set nocompatible              
2
set backspace=indent,eol,start
3
filetype off                 
4
5
6
set rtp+=~/.vim/bundle/Vundle.vim
7
call vundle#begin()
8
Plugin 'VundleVim/Vundle.vim'
9
Plugin 'fatih/vim-go'
10
Plugin 'majutsushi/tagbar'
11
Plugin 'fatih/molokai'
12
Plugin 'godlygeek/tabular' " mark before
13
Plugin 'plasticboy/vim-markdown'
14
Plugin 'suan/vim-instant-Markdown'
15
Plugin 'Valloric/YouCompleteMe'
16
Plugin 'jiangmiao/auto-pairs'
17
call vundle#end()       
18
19
filetype plugin indent on 
20
21
syntax on
22
set nu
23
set cursorline
24
25
26
" vim-go configure
27
let g:go_fmt_command = "goimports"
28
let g:go_autodetect_go_path = 1
29
let g:go_list_type = "quickfix"
30
let g:go_version_warning = 1
31
let g:go_highlight_types = 1
32
let g:go_highlight_fields = 1
33
let g:go_highlight_functions = 1
34
let g:go_highlight_function_calls = 1
35
let g:go_highlight_operators = 1
36
let g:go_highlight_extra_types = 1
37
let g:go_highlight_methods = 1
38
let g:go_highlight_generate_tags = 1
39
let g:godef_split = 2
40
41
" molokai
42
colorscheme molokai
43
let g:rehash256 = 1
44
let g:molokai_original = 1
45
46
" ctags
47
nmap <F8> :TagbarToggle<CR>
48
let g:tagbar_type_go = {
49
    \ 'ctagstype' : 'go',
50
    \ 'kinds'     : [
51
        \ 'p:package',
52
        \ 'i:imports:1',
53
        \ 'c:constants',
54
        \ 'v:variables',
55
        \ 't:types',
56
        \ 'n:interfaces',
57
        \ 'w:fields',
58
        \ 'e:embedded',
59
        \ 'm:methods',
60
        \ 'r:constructor',
61
        \ 'f:functions'
62
    \ ],
63
    \ 'sro' : '.',
64
    \ 'kind2scope' : {
65
        \ 't' : 'ctype',
66
        \ 'n' : 'ntype'
67
    \ },
68
    \ 'scope2kind' : {
69
        \ 'ctype' : 't',
70
        \ 'ntype' : 'n'
71
    \ },
72
    \ 'ctagsbin'  : 'gotags',
73
    \ 'ctagsargs' : '-sort -silent'
74
\ }