On Wed, Mar 11, 2009 at 01:29:01PM -0700, fossist wrote: > > I read the documentation. CTRL-O behavior seemed to be pretty clear. > But, I am unable to understand the CTRL-O behavior. Here is what I did > after launching vim.
Be sure to also read the documentation on tags: :he tags > :help > /bars > CTRL-] > 5k > CTRL-] > /Vim (takes the cursor to VimEnter) > CTRL-] > /dying > CTRL-] > > Now I start going back but notice I mix CTRL-O and CTRL-T to do so. > > CTRL-O (takes me back to v:dying link > CTRL-O (takes me back to VimEnter) > CTRL-O (takes me back to Vim link) > CTRL-T (takes me forward to v:dying link again) > CTRL-T (takes me back to Vim link again) > CTRL-T (takes me back to pi_zip.txt) > CTRL-O (takes me forward to Vim link again) > CTRL-O (takes me forward to v:dying link again) > CTRL-O (takes me forward to v:dying section) > CTRL-O (takes me back to VimEnter) > CTRL-O (takes me back to bars) > > As you can see if I mix CTRL-O and CTRL-T, it becomes difficult for me > to predict the behavior. It is easy to understand where I am going to > move next if I press CTRL-T by using the :jumps command. But I don't > seem to understand why when I press CTRL-T suddenly it moves forward > to some unpredictable place. > > Can someone please help me understand what is going on? What is happening is that Vim is using two means of keeping track of where you are in the code. These are the jumplist, and the tagstack. The jumplist is traversed with Ctrl-O and Ctrl-I. I think of Ctrl-O and Ctrl-I as being analogous to the back and forward buttons (respectively) in your web browser. Every time you issue a command that affects the jumplist, it's like clicking a link on a web page. You can use Ctrl-O and Ctrl-I to navigate between them Ctrl-] and Ctrl-T manipulate the tagstack, which is a separate entity from the jumplist. Although jumping between tags is noted on the jumplist, Ctrl-O and Ctrl-I don't change Vim's notion of where you are on the tagstack. > Also, is there > a list of jumps that CTRL-T would take me through that I can see by > using a command similar to :jumps? :tags will list the tags on the tagstack, and point to the active entry :ju[mps] will display the jumplist, and point to the active jump position. I hope this begins to untangle things for you. -- Erik Falor Registered Linux User #445632 http://counter.li.org --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
