How to use multiple tabs when tagging to a function in Vim

前端 未结 3 976
天命终不由人
天命终不由人 2020-12-29 09:48

I use ctags with my Vim and I rely heavily on C-] and C-T to tag back and froth between various functions in my project.

But if the function is in a different file,

3条回答
  •  囚心锁ツ
    2020-12-29 10:02

    nmap  T
    

    Does this help ? You could probably figure out something similar for the way back.


    Well, we need to decide what would be the wanted behaviour. We can go back to the original tab (not sure how, still investigating) but then the above given mapping is gonna open a new tab next time. So you'll end up with a lot of tabs after a while.

    Or we can do C, which will close the opened tab and take us back to the original one. I, personally, prefer this way of working (that way I don't lose my position in the file) I go to the function I want, make my corrections there then return to the original file from which I started. Let me know, what would you like (this didn't fit in comments so I put the answer here).

提交回复
热议问题