Skip to content

Instantly share code, notes, and snippets.

@mmcdaris
Last active August 29, 2015 14:07
Show Gist options
  • Save mmcdaris/e94635e45b571f81d37f to your computer and use it in GitHub Desktop.
Save mmcdaris/e94635e45b571f81d37f to your computer and use it in GitHub Desktop.
my vimrc with
" ===== vim-go - github.com/fatih/vim-go =====
" goimports
let g:gofmt_command ="goimports"
" gofmt on save
autocmd FileType go autocmd BufWritePre <buffer> Fmt
" useful maps
au FileType go nmap <leader>r <Plug>(go-run)
au FileType go nmap <leader>d :Godoc<CR>
au FileType go nmap <leader>df <Plug>(go-def-horizontal)
au FileType go nmap <leader>gi <Plug>(go-implements)
" ===== ultisnips - github.com/SirVer/ultisnips =====
" Trigger configuration. Do not use <tab> if you use
" https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<c-j>"
" :UltiSnipsEdit to splits
let g:UltiSnipsUsePythonVersion = 2
let g:UltiSnipsEditSplit="vertical"
" map
nmap <leader>s :UltiSnipsEdit<CR>
" ===== tagbar - github.com/majutsushi/tagbar =====
nmap <leader>] :TagbarToggle<CR>
autocmd VimEnter * nested :call tagbar#autoopen(1)
" ===== GOTAGS - github.com/jstemmer/gotags =====
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'
\ }
" ===== YouCompleteMe - github.com/Valloric/YouCompleteMe =====
" This worked for me
" git clone https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe
" cd ~/.vim/bundle/YouCompleteMe
" ./install.sh --clang-completer
" ===== GoCode =====
" go get github.com/nsf/gocode
" cd $GOPATH/src/github.com/nsf/gocode/vim
" cp -r ./* $HOME/.vim/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment