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

:vi<br />

Bonus Hack 12. Place the cursor at the end of the<br />

match<br />

When you search inside Vim using /pattern, by default the cursor will be<br />

placed at the beginning of the match.<br />

But when you want the cursor to be placed at the end of the match, you can<br />

use /PATTERN\zs<br />

Cursor at the beginning of the pattern<br />

/pattern<br />

Cursor at the end of the pattern<br />

/pattern\zs<br />

Bonus Hack 13. View ASCII value of a character<br />

For some reason, if you want to know a decimal, Hex and Octal value of a<br />

character, move your cursor to the character on press ga, which will display<br />

the ASCII value as shown below.<br />

163

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

Saved successfully!

Ooh no, something went wrong!