14.06.2014 Views

vim 101 hacks

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Buyer: xiujuan lu (luxiujuan@gmail.com)<br />

Transaction ID: 85W16630AD8515549<br />

Vim <strong>101</strong> Hacks<br />

www.thegeekstuff.com<br />

Usage 3. Returning back to the caller from the definition using<br />

CTRL-T<br />

After using CTRL-] to jump to a function definition, you can press CTRL-T<br />

which will take you back to the function call again.<br />

Usage 4. Navigating through a list of functions which have similar<br />

names<br />

In this example, :ta will go to first function definition whose name starts with<br />

get. Vim also builds a list of all the functions whose names start with get<br />

which we can navigate.<br />

# <strong>vim</strong> mycprogram.c<br />

:ta /^get<br />

The following Vim commands can be used to navigate through the matched<br />

tag list.<br />

Vim command<br />

:ts<br />

Description<br />

Display the tag list<br />

:tn<br />

Go to the next tag in the list<br />

:tp<br />

Go to the previous tag in the list<br />

:tf<br />

Go to the first function in the list<br />

:tl<br />

Go to the last function in the list<br />

43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!