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