From f6071206f035adb718ab5ffafd7b60f6ffecddf1 Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Mon, 23 Aug 2021 16:36:56 -0600 Subject: [PATCH] added color rules and golang settings --- vim/color.vim | 1 + vim/formatting.vim | 8 ++++++++ vim/vundle.vim | 29 +++++++++++++++++++++-------- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/vim/color.vim b/vim/color.vim index d32f4a0..001c4fb 100644 --- a/vim/color.vim +++ b/vim/color.vim @@ -6,3 +6,4 @@ set t_Co=256 highlight Normal guibg=NONE ctermbg=NONE highlight SpellBad ctermbg=NONE ctermfg=red highlight LineNr ctermfg=yellow +highlight SignColumn guibg=NONE ctermbg=NONE diff --git a/vim/formatting.vim b/vim/formatting.vim index 600b68e..57cedfe 100644 --- a/vim/formatting.vim +++ b/vim/formatting.vim @@ -33,6 +33,8 @@ augroup filetype_specific_formatting autocmd FileType kotlin call FormatFileType(2, v:true, 'indent', 99, v:false) autocmd FileType dockerfile call FormatFileType(4, v:true, 'indent', 99, v:false) autocmd FileType vue call FormatFileType(2, v:true, 'indent', 99, v:false) + autocmd FileType go call FormatFileType(4, v:false, 'manual', 99, v:false) + autocmd FileType json call FormatFileType(2, v:false, 'indent', 99, v:false) augroup end augroup forced_filetype_recognition @@ -49,6 +51,7 @@ augroup end augroup execute_file_shortcuts autocmd FileType tex nnoremap ec :! pdf=$(grep -rl 'documentclass' ./ head -n 1 sed 's/\(.*\)\.tex/\1.pdf/'); $WEBBROWSER $pdf autocmd FileType markdown nnoremap ec :! $WEBBROWSER %:p + autocmd FileType go nnoremap ec :!clearq:?GoRun augroup end " }}} @@ -61,6 +64,11 @@ augroup latex_commands autocmd FileType tex nnoremap t :! clear; texfile=$(grep -rl 'documentclass' ./ head -n 1); timeout 3 pdflatex $texfile && { clear; pdflatex $texfile lolcat } augroup end + +augroup go_commands + autocmd FileType go nmap ef (go-imports) + autocmd FileType go nmap gd (go-def-tab) +augroup end " }}} diff --git a/vim/vundle.vim b/vim/vundle.vim index df1b1e4..7cf0cb0 100644 --- a/vim/vundle.vim +++ b/vim/vundle.vim @@ -17,6 +17,9 @@ Plugin 'VundleVim/Vundle.vim' " nerdtree Plugin 'git://github.com/scrooloose/nerdtree.git' +" go-vim + Plugin 'fatih/vim-go' + " youCompleteMe Plugin 'git://github.com/Valloric/YouCompleteMe.git' @@ -61,22 +64,32 @@ function! ToggleYCM() endif endfunction +" uncomment to deactivate by default +" let g:ycm_auto_trigger=0 +let g:ycm_autoclose_preview_window_after_insertion = 1 let g:ycm_goto_buffer_command = 'new-tab' nnoremap :call ToggleYCM() nnoremap gd :YcmCompleter GoToDefinition -" STARTS DEACTIVATED -" let g:ycm_auto_trigger=0 - " --- ALE --------------------------------------------------------------------------- let g:ale_linters = { \ 'cs' : ['OmniSharp'], -\ 'python' : ['pylint'] +\ 'python' : ['pylint'], +\ 'go' : ['golint'] \} -let g:ale_lint_on_text_changed = 'never' -let g:ale_lint_on_insert_leave = 'never' +let g:ale_lint_on_text_changed = 0 +let g:ale_lint_on_insert_leave = 0 +let g:ale_lint_on_save = 1 +let g:ale_sign_column_always = 1 -nnoremap ae :ALENext -nnoremap ar :ALEPrevious +nmap ae (ale_next) +nmap ar (ale_previous) + +" --- vim-go ------------------------------------------------------------------------ +let g:go_imports_autosave = 0 +let g:go_def_mapping_enabled = 0 +let g:go_fmt_fail_silently = 1 +let g:go_def_reuse_buffer = 1 +let g:go_textobj_enabled = 0