From 5ffcb2c3a003ceb923168f17afd23b87078e048d Mon Sep 17 00:00:00 2001 From: Edgaru089 Date: Fri, 20 Jun 2025 18:32:31 +0800 Subject: [PATCH] vim: fix the stupid Ctrl-I https://vi.stackexchange.com/questions/39717/mapping-to-ctrlm-and-ctrli-in-neovim Also nmap K into jumping to definition. Use Ctrl-O/I to jump around the jumplist. --- vimrc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/vimrc b/vimrc index e20980a..cae27af 100644 --- a/vimrc +++ b/vimrc @@ -192,9 +192,7 @@ autocmd FileType c,cpp,go,rust,typescript inoremap {} autocmd FileType vim,tex,python inoremap { {} autocmd FileType vim,tex,python inoremap {} -autocmd Filetype go,rust,python,typescript map K CocAction("jumpDefinition") -autocmd FileType c,cpp map K CocAction("jumpDeclaration") -autocmd FileType c,cpp map CocAction("jumpDefinition") +autocmd Filetype c,cpp,go,rust,python,typescript nmap K (coc-definition) augroup END @@ -216,9 +214,18 @@ else inoremap coc#refresh() endif +" Guess what? Despite Neovim being smart enough to distinguish +" from , it treats as anyways if +" you have a normal mode mapping for . Screw me I guess. +" +" https://vi.stackexchange.com/a/46704 +" https://github.com/neovim/neovim/pull/17932 +" +" This magical line tricks Nvim into being smart again. +nnoremap + " Press Meta-I to invoke hover nmap :call CocAction('doHover') -"nmap CocAction('doHover') " Use tab for trigger completion / cycle snippet replaces. inoremap