Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between C-T and C-o in vim?

Tags:

vim

These 2 vim keyboard shortcuts seems for similar purpose, <C-T> goes back previous tag in the history, and <C-o> goes to previous entry in the jump list. Any difference between these 2?

like image 408
Thomson Avatar asked Dec 21 '14 10:12

Thomson


1 Answers

The tag stack is populated only when you jump to a tag using something like :tag foo or <c-]>. This means that you can do any number of non-tag-related jumps between your <C-]>s and <C-t>s without altering the tag stack and be pretty confident that <C-t> will always jump you to the latest tag you visited and from where.

The jump list, on the other hand, will record all the jumps you did between your tag-related jumps so <C-o> will usually take quite a few more attempts to go back to where you want to go than <C-t>.

Think about <C-o> as a "catchall" way to go back and <C-t> as more specialized version of <C-o>.

like image 89
romainl Avatar answered Oct 01 '22 14:10

romainl