Skip to content

Commit 56ca0aa

Browse files
committed
feat: Add VS Code/Visual Studio compatible navigation keybindings
1 parent 6a5612a commit 56ca0aa

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

plugins.vim

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,22 @@ function! OnLoadCoc() abort
257257
nmap <silent> gy <Plug>(coc-type-definition)
258258
nmap <silent> gi <Plug>(coc-implementation)
259259
nmap <silent> gr <Plug>(coc-references)
260-
" Additional mappings for convenience
260+
261+
" Additional vim-style mappings
261262
nmap <silent> <C-t> <Plug>(coc-definition)
262263
nmap <silent> <leader>g <Plug>(coc-definition)
263264
nmap <silent> <leader>G <Plug>(coc-type-definition)
264-
nmap <F12> <Plug>(coc-definition)
265-
nmap <C-F12> <Plug>(coc-type-definition)
265+
266+
" VS Code / Visual Studio compatible mappings
267+
nmap <silent> <F12> <Plug>(coc-definition)
268+
nmap <silent> <C-F12> <Plug>(coc-implementation)
269+
nmap <silent> <S-F12> <Plug>(coc-references)
270+
" Note: Alt+F12 would be peek definition, but Vim doesn't have peek mode
271+
" Note: Ctrl+Shift+F12 for type definition conflicts with terminal behavior
272+
273+
" Navigation history (VS Code compatible)
274+
" Note: Alt+Left/Right often conflicts with terminal, using Ctrl+O/I instead
275+
" Vim already has Ctrl+O (back) and Ctrl+I (forward) for jump list
266276

267277
" Highlight references on CursorHold
268278
autocmd CursorHold * silent! call CocActionAsync('highlight')

0 commit comments

Comments
 (0)