How would I "Goto Definition" in a separate tab? Here's my .vimrc config:
nmap <silent> \ge <Plug>(coc-definition)
nmap <silent> \gs :split<CR><Plug>(coc-definition)
nmap <silent> \gv :vsplit<CR><Plug>(coc-definition)
nmap <silent> \gt :tabnew<CR><Plug>(coc-definition)
The first three options work, (open, open in split, open in vsplit) but not the last.
I see that there is a Config setting ("coc.preferences.jumpCommand") but am hoping there is a way set a keybinding in my vimrc.
Any ideas?
OK this seems to work:
nmap <silent> \ge <Plug>(coc-definition)
nmap <silent> \gs :sp<CR><Plug>(coc-definition)
nmap <silent> \gv :vsp<CR><Plug>(coc-definition)
nmap <silent> \gt :vsp<CR><Plug>(coc-definition)<C-W>T
:h coc-action-jumpDefinition
@chemzqm thanks for the hint. Here's the syntax that worked for me:
:call CocAction('jumpDefinition', 'split')
:call CocAction('jumpDefinition', 'vsplit')
:call CocAction('jumpDefinition', 'tabe')
I've tried:
nmap <silent> gd <Plug>(coc-action-jumpDefinition)
but it does not work, how can i set the "jumpDefinition" to open on a new "vsplit"?
@rafa-acioly you need to understand function and key-mapping of vim.
Hey @rafa-acioly,
take a look at :help n_coc-definition@en I think that's what you are looking for.
@rafa-acioly you need to understand function and key-mapping of vim.
@rafa-acioly you need to understand function and key-mapping of vim.
what is the best video to learn that
Most helpful comment
@chemzqm thanks for the hint. Here's the syntax that worked for me: