1
0
Fork 0
numbers/nvim/after/ftplugin/go.vim

45 lines
1.4 KiB
VimL

setlocal noexpandtab
setlocal shiftwidth=4
setlocal tabstop=4
setlocal foldmethod=syntax
let g:go_textobj_include_function_doc = 1
let g:go_auto_type_info = 1
let g:go_auto_sameids = 1
let g:go_autodetect_gopath = 1
let g:go_imports_autosave = 1
let g:go_doc_popup_window = 1
let g:go_gopls_enabled = 1
let g:go_metalinter_autosave = 1
let g:go_fmt_command = "goimports"
let g:go_list_type = "quickfix"
" Go syntax highlighting
let g:go_highlight_build_constraints = 1
let g:go_highlight_fields = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_operators = 1
let g:go_highlight_structs = 1
let g:go_highlight_types = 1
let g:go_highlight_extra_types = 1
let g:go_play_browser_command = 'tmux new-window elinks %URL%'
" Status line types/signatures
let g:go_auto_type_info = 1
" Add the failing test name to the output of :GoTest
let g:go_test_show_name = 1
inoremap <buffer> . .<C-x><C-o>
nmap <buffer><leader>d :<Plug>(go-def)
nmap <buffer><leader>t :GoTest!<CR>
nmap <buffer><leader>b :GoBuild!<CR>
nmap <buffer><leader>i :GoInstall!<CR>
nmap <buffer><leader>R :GoRun %<CR>
nmap <buffer><leader>x :GoDebugStart!<CR>
nmap <buffer><leader>r :GoRun!<CR>
nmap <buffer><leader>m :GoDoc<CR>
nmap <buffer><leader>D :GoDocBrowser<CR>