3

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)
halfer
  • 19,824
  • 17
  • 99
  • 186
svelandiag
  • 4,231
  • 1
  • 36
  • 72
  • Thank you however not sure how to translate the command to what I need, I just updated my answer so you understand how I have it mapped – svelandiag Jun 03 '21 at 21:10
  • well it opens another "kind of" tab, but it's not a tab, however, it just stays on the file, does not go to the definition – svelandiag Jun 03 '21 at 21:24
  • What I meant is that it's not the regular terminal tab that opens when I press `cmd+t` – svelandiag Jun 03 '21 at 21:33
  • Oh I see - I thought you meant vim tabs. I'll remove these my comments so as not to clutter you post. Good luck with finding a solution! – mattb Jun 03 '21 at 21:36
  • Ho wel I think you were close as well, if I can manage to do what I need using vim tabs that would work as well! – svelandiag Jun 03 '21 at 21:50

1 Answers1

4

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.

fannheyward
  • 18,599
  • 12
  • 71
  • 109