diff --git a/vim/.vimrc b/vim/.vimrc index 22fb325..5dfea95 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -50,6 +50,7 @@ call matchadd('ColorColumn', '\%81v', 100) if has("autocmd") + autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab autocmd FileType gohtmltmpl setlocal ts=2 sts=2 sw=2 expandtab @@ -82,24 +83,40 @@ let g:syntastic_auto_loc_list = 1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 1 let g:syntastic_aggregate_errors = 1 -" let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck'] +let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck'] " let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] } let g:syntastic_javascript_checkers = ['eslint'] let g:syntastic_java_javac_config_file_enabled = 1 " Vim-go options -let g:go_fmt_command = "goreturns" -let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck', 'structcheck', 'deadcode', 'gocyclo', 'ineffassign', 'dupl', 'gotype', 'varcheck', 'interfacer', 'gosimple', 'staticcheck', 'misspell'] +let g:go_fmt_command = "goimports" +let g:go_fmt_autosave = 1 +let g:go_metalinter_command = "golangci-lint" +let g:go_metalinter_enabled = ['govet', 'golint', 'errcheck', 'staticcheck', 'unused', 'gosimple', 'structcheck', 'varcheck', 'ineffassign', 'deadcode', 'gosec', 'unconvert', 'dupl', 'goconst', 'gocyclo', 'misspell', 'unparam', 'lll', 'interfacer', 'nakedret', 'scopelint'] let g:go_metalinter_autosave = 1 -let g:go_metalinter_autosave_enabled = ['vet', 'golint', 'errcheck', 'structcheck', 'deadcode', 'gocyclo', 'ineffassign', 'dupl', 'gotype', 'varcheck', 'interfacer', 'gosimple', 'staticcheck', 'misspell'] -let g:go_get_update = 0 +"let g:go_metalinter_autosave_enabled = ['govet', 'golint', 'errcheck'] +let g:go_metalinter_autosave_enabled = ['govet', 'golint', 'errcheck', 'staticcheck', 'unused', 'gosimple', 'structcheck', 'varcheck', 'ineffassign', 'deadcode', 'gosec', 'unconvert', 'dupl', 'goconst', 'gocyclo', 'misspell', 'unparam', 'lll', 'interfacer', 'nakedret', 'scopelint'] let g:go_list_type = "quickfix" let g:go_highlight_functions = 1 +let g:go_highlight_function_parameters = 1 +let g:go_highlight_function_calls = 1 let g:go_highlight_methods = 1 let g:go_highlight_fields = 1 let g:go_highlight_types = 1 let g:go_highlight_operators = 1 let g:go_highlight_build_constraints = 1 +let g:go_highlight_generate_tags = 1 +let g:go_highlight_extra_types = 1 +let g:go_highlight_array_whitespace_error = 1 +let g:go_highlight_chan_whitespace_error = 1 +let g:go_highlight_space_tab_error = 1 +let g:go_highlight_trailing_whitespace_error = 1 +let g:go_highlight_variable_declarations = 1 +let g:go_info_mode = 'gopls' +let g:go_test_show_name = 1 +let g:go_test_timeout= '60s' +let g:go_auto_type_info = 1 +let g:go_jump_to_error = 0 if has("autocmd") autocmd FileType go nmap b (go-build) autocmd FileType go nmap r (go-run) @@ -109,6 +126,8 @@ if has("autocmd") autocmd FileType go nmap C (go-cover-clear) autocmd FileType go nmap a (go-alternate) autocmd FileType go nmap f (go-fmt) + autocmd FileType go nmap d (go-def) + autocmd FileType go nmap m (go-metalinter) endif " vimwiki options @@ -125,7 +144,7 @@ let g:vimwiki_list = [{'path': '~/Notebook/work', let g:vimwiki_ext2syntax = {'.md': 'markdown'} " Grammalecte options -let g:grammalecte_cli_py='/usr/bin/grammalecte-cli.py' +let g:grammalecte_cli_py='/usr/bin/grammalecte' " IndentGuide options let g:indent_guides_auto_colors = 0 @@ -174,3 +193,4 @@ nnoremap h :cclose " Removes trailing whitespaces nnoremap s :keeppattern %s/\s\+$// +autocmd BufNewFile,BufRead *.tmpl set syntax=gohtmltmpl