Skip to content

Instantly share code, notes, and snippets.

@jgworks
Created February 17, 2017 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jgworks/16ac999ac066248bddd27fb63ca24fc6 to your computer and use it in GitHub Desktop.
Save jgworks/16ac999ac066248bddd27fb63ca24fc6 to your computer and use it in GitHub Desktop.
vim-go shortcuts
command! W w
command! Q q
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
let g:go_fmt_command = "goimports"
let g:go_metalinter_enabled = 1
"au FileType go nmap <Leader>r <Plug>(go-run)
"au FileType go nmap <Leader>b <Plug>(go-build)
"au FileType go nmap <Leader>t <Plug>(go-test)
"au FileType go nmap <Leader>c <Plug>(go-coverage)
au FileType go nmap <Leader>dg <Plug>(go-def)
au FileType go nmap <Leader>ds <Plug>(go-def-split)
au FileType go nmap <Leader>dv <Plug>(go-def-vertical)
au FileType go nmap <Leader>dt <Plug>(go-def-tab)
au FileType go nmap <Leader>gd <Plug>(go-doc)
au FileType go nmap <Leader>gv <Plug>(go-doc-vertical)
au FileType go nmap <Leader>s <Plug>(go-implements)
au FileType go nmap <Leader>i <Plug>(go-info)
au FileType go nmap <Leader>e <Plug>(go-rename)
au FileType go nmap <Leader>gr <Plug>(go-referrers)
au FileType go nmap <Leader>gc <Plug>(go-callers)
au FileType go nmap <Leader>ge <Plug>(go-callees)
map <C-n> :NERDTreeToggle<CR>
"How can I close vim if the only window left open is a NERDTree?
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment