From 310979a19f2f4cc36564008e0e32e1b1d460c6b5 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Wed, 8 Sep 2021 10:36:38 +0800 Subject: [PATCH] feat: for golang dev --- cli/vim/coc-settings.json | 7 ++++++- cli/vim/init.vim | 13 +++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cli/vim/coc-settings.json b/cli/vim/coc-settings.json index dbaaa29..5b82291 100644 --- a/cli/vim/coc-settings.json +++ b/cli/vim/coc-settings.json @@ -5,5 +5,10 @@ "python.linting.pylintEnabled": false, "diagnostic-languageserver.filetypes": { "sh": "shellcheck" - } + }, + "coc.preferences.formatOnSaveFiletypes": [ + "rust", + "json", + "go" + ] } diff --git a/cli/vim/init.vim b/cli/vim/init.vim index 38efb57..26433fc 100644 --- a/cli/vim/init.vim +++ b/cli/vim/init.vim @@ -75,7 +75,13 @@ function! WSLCopy() call system('xsel -b', join(lines, "\n")) endfunction +function! YankFileLineNo() + let @+=expand("%") . ':' . line(".") + echo @+ +endfunction + xnoremap y :call WSLCopy() +nnoremap yl :call YankFileLineNo() nmap "" ysiW" nmap '' ysiW' @@ -99,11 +105,13 @@ au ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red au Syntax * match ExtraWhitespace /\s\+$/ nnoremap es :%s/\s\+$//g - " location jumping nnoremap n :cnext nnoremap p :cprev +" cusorline +nnoremap cc :set cursorcolumn! + " auto install vim-plug if has('nvim') if has('win32') @@ -329,9 +337,6 @@ endfu nnoremap ac :call ToggleGroffMomAutoCompilation() autocmd BufEnter,BufRead *.mom :set ft=mom -" for yaml need cursorcolumn -autocmd FileType yaml :set cursorcolumn - " spell highlight highlight clear SpellBad highlight SpellBad cterm=underline