$ vim $HOME/.zprofile
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export GOPATH="$HOME/go"
export GOROOT="/usr/local/go"
export PATH="$GOROOT/bin:$GOPATH/bin":$PATH
alias ctags="`brew --prefix`/bin/ctags"
$ git clone --recursive https://github.com/LyricTian/vim.git $HOME/vim
$ ln -sf $HOME/vim/.vim $HOME/.vim
$ ln -sf $HOME/vim/.vimrc $HOME/.vimrc
$ mvim
:PluginInstall
更新工具使用
:GoUpdateBinaries
:GoInstallBinaries
$ cd $HOME/.vim/bundle/YouCompleteMe
$ ./install.py --gocode-completer
" for tools
map <c-n><c-t> :NERDTreeToggle<cr>
map <c-t><c-t> :TagbarToggle<cr>
" for golang
autocmd FileType go noremap <buffer> <c-g><c-b> :GoBuild<cr>
autocmd FileType go noremap <buffer> <c-g><c-h> :GoDoc<cr>
autocmd FileType go noremap <buffer> <c-g><c-p> :GoDefPop<cr>
autocmd FileType go noremap <buffer> <c-g><c-d> :GoDef<cr>
autocmd FileType go noremap <buffer> <c-g><c-i> :GoImports<cr>
autocmd FileType go noremap <buffer> <c-g><c-r> :GoReferrers<cr>
autocmd FileType go noremap <buffer> <c-g><c-m> :GoMetaLinter<cr>
autocmd FileType go noremap <buffer> <c-g><c-v> :GoVet<cr>
autocmd FileType go noremap <buffer> <c-g><c-l> :GoLint<cr>
" for javascript
autocmd FileType javascript noremap <buffer> <c-j><c-f> :call JsBeautify()<cr>
" for json
autocmd FileType json noremap <buffer> <c-j><c-f> :call JsonBeautify()<cr>
" for jsx
autocmd FileType jsx noremap <buffer> <c-j><c-f> :call JsxBeautify()<cr>
" for html
autocmd FileType html noremap <buffer> <c-j><c-f> :call HtmlBeautify()<cr>
" for css or scss
autocmd FileType css noremap <buffer> <c-j><c-f> :call CSSBeautify()<cr>
Copyright (c) 2016 Lyric