Friday, September 3, 2010

Vim for code navigation

I really want to learn to use vi for navigating through code files.
But I'm running into a couple of issues:
To jump to a tag I think I should use ctrl+], but if I've changed
the file it keeps prompting me that I need to use ! to override. I
know
I can use '!' for one of the colon commands. How do I do it for ctrl
+]?
Also, I don't want it to blindly jump to the code - if there are
multiple
matches i want to choose where to go.
I tried using :ts and :ta but it seems like that's not what I
want
either since it jumps to what's already on the stack. Maybe I need to
make a vi shortcut to push the function I want to go to onto the
stack,
close the new buffer so the tag is still on the stack, then jump to
the
tag that's at the top of the stack? And also when I close one buffer
(with :bd), it doesn't seem to go back to the position on the line I
last left off on, so maybe I need to make a mark before jumping to
the
function, so I can get back to it? This seems really cumbersome, and
I'm sure navigating through functions is easier than that.
Again, the difficulty is that I want to step into a function
without
writing the file that I'm on. I could probably open it with ctrl+w,
then
maximize it. Then when I want to get back, I can just close the
window
instead of popping it off the stack. If I open the function in a new
window with ctrl+w, then hitting ctrl+t on the code I jumped to
results
in the same code appearing in 2 windows, top and bottom.

Thanks,
Ven

--
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:

Post a Comment