Friday, March 5, 2010

Cycle Ctrl+]

Hi,

Such a question, Ctrl+] always jump to the first matching tag, to go to the next tag there is :tn and :tp for previous. How to make Ctrl+] first time act as normal, next press it will work as :tn until we reach the top of the stack, then it will go to the first tag in the tag list and continue act as :tn.

The main condition is make it jump to the tag itself, not the beginning of the signature. With such a peace of code:

int foo();
...
int foo(){}
...
int a = foo();

we do Ctrl+] on the call to foo(), and jump to either definition or declaration of foo(), whatever the first comes, the problem is that it places the cursor in the beginning of the line, where *int* is, so doing Ctrl+] again will try to find the match for *int* tag and fail of course.

If that is tough to do, I will be happy with at least a key mapping which I could use after Ctrl+] and cycle through the tag stack.

--
Aarto

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: