Use: tjump instead of: tag vim when pressing ctrl-]

in vim,
when I ctrl-]

1) normal behavior:
it goes to the first matching tag with the word under the cursor, after that we need to do :tjump separately to view a list of all matching tags, and then go to the desired tag.

2) what i want:
vim should look for the tag file,
if there are multiple matches, show me a list of all matching tags
if there is one match, just go to the corresponding tag
(exactly the same as :tjump )

this behavior (2) already happens when we use g-ctrl-] , but I want this to happen with ctrl-]
I saw behavior (2) using ctrl-] in some vims in some linues.

please tell me how I can get the behavior (2). in other words,
please tell me how can I make ctrl-] behave like g-ctrl-] with .vimrc or whatever

+7
source share
1 answer

This will display <c-]> in g<c-]> for normal and visual modes.

 nnoremap <c-]> g<c-]> vnoremap <c-]> g<c-]> 

I suggest you map g<c-]> to <c-]> . In other words, just swap commands.

 nnoremap g<c-]> <c-]> vnoremap g<c-]> <c-]> 
+12
source

All Articles