coc.nvim: Open function or class definition in a new terminal tab

2.1k Views Asked by At

Most of the time I use the gd command then I have to browse the file manually in a new terminal tab, because I still need to leave open the previous file.

It would be just a bit useful to be able to open the definition in a new tab, of course, I'm just wondering if this is possible and how to configure it, probably mapping a new command in the nvim config file?

This is how I'm mapping the gd command:

nmap <silent> gd <Plug>(coc-definition)
1

There are 1 best solutions below

1
On BEST ANSWER

You shouldn't open in new terminal tab, because this means you'll start a new vim process instance and will launch a new language server process that you use. If you're using some other vim remote plugins, they'll be loaded again.

You can set "coc.preferences.jumpCommand": "tabe" in your coc-settings.json, this will open in vim tabs.