vimrc配置
目前用的插件比较少,以后慢慢补充,用的是vundle管理插件的方式,具体步骤如下:
安装vundle,参见https://github.com/gmarik/Vundle.vim
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
go语言的语法支持,安装godef和gotags以及gocode
go get code.google.com/p/rog-go/exp/cmd/godef go get github.com/jstemmer/gotags go get -u github.com/nsf/gocode
vimrc中的go相关配置
Bundle 'Blackrush/vim-gocode' Bundle 'cespare/vim-golang' Bundle 'dgryski/vim-godef' " go highlight filetype off filetype plugin indent off set runtimepath+=$GOROOT/misc/vim filetype plugin indent on syntax on
tagbar和nerdtree
Bundle 'scrooloose/nerdtree' let NERDTreeWinPos='left' let NERDTreeWinSize=31 let NERDTreeChDirMode=1 "F7 打开nerdtree map <F7> :NERDTreeToggle<CR> Bundle 'majutsushi/tagbar' nmap <F8> :TagbarToggle<CR>
全部的vimrc
set nocompatible " be iMproved filetype off " required! set rtp+=~/.vim/bundle/vundle/ call vundle#rc() Bundle 'gmarik/vundle' Bundle 'Blackrush/vim-gocode' Bundle 'cespare/vim-golang' Bundle 'dgryski/vim-godef' Bundle 'scrooloose/nerdtree' let NERDTreeWinPos='left' let NERDTreeWinSize=31 let NERDTreeChDirMode=1 "F7 打开nerdtree map <F7> :NERDTreeToggle<CR> Bundle 'majutsushi/tagbar' nmap <F8> :TagbarToggle<CR> let g:tagbar_type_go = { \ 'ctagstype' : 'go', \ 'kinds' : [ \ 'p:package', \ 'i:imports:1', \ 'c:constants', \ 'v:variables', \ 't:types', \ 'n:interfaces', \ 'w:fields', \ 'e:embedded', \ 'm:methods', \ 'r:constructor', \ 'f:functions' \ ], \ 'sro' : '.', \ 'kind2scope' : { \ 't' : 'ctype', \ 'n' : 'ntype' \ }, \ 'scope2kind' : { \ 'ctype' : 't', \ 'ntype' : 'n' \ }, \ 'ctagsbin' : 'gotags', \ 'ctagsargs' : '-sort -silent' \ } filetype plugin indent on " required! " go highlight filetype off filetype plugin indent off set runtimepath+=$GOROOT/misc/vim filetype plugin indent on syntax on
发表评论