Skip to content

Instantly share code, notes, and snippets.

@jacoelho
Last active April 30, 2021 20:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jacoelho/75b19b90cecd378d824d0e8a404dd77c to your computer and use it in GitHub Desktop.
Save jacoelho/75b19b90cecd378d824d0e8a404dd77c to your computer and use it in GitHub Desktop.
spf13-vim + vim-go
  1. Install spf13-vim
sh <(curl https://j.mp/spf13-vim3 -L)
  1. Install Go bundle
echo "export PATH=\$PATH:\$(go env GOPATH)/bin" >> ~/.bashrc
echo "Bundle 'dracula/vim'" >> ~/.vimrc.bundles.local
echo "let g:spf13_bundle_groups=['general', 'neocomplete', 'neocomplcache', 'programming', 'go' ]" >> ~/.vimrc.before.local 
vim +BundleInstall! +GoInstallBinaries +qall
  1. Config .vimrc.local
" Customize
let g:indent_guides_enable_on_vim_startup = 0

" Use neocomplete
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" <TAB>: completion
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"

" Theme
colorscheme dracula

" vim-go
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" :GoDef
au Filetype go nmap gd <Plug>(go-def)

" tagbar
nmap <F8> :TagbarToggle<CR>
" ctags
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'
\ }

" nerdtree
map <C-n> :NERDTreeToggle<CR>
  1. Remove annoying indent highlight
:set nolist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment