14.06.2014 Views

vim 101 hacks

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

Transaction ID: 85W16630AD8515549<br />

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

www.thegeekstuff.com<br />

When you type :write, this will be replaced with :!cc % & ./a.out and then<br />

Vim will use $SHELL to compile the C program and execute the a.out.<br />

Additional Map Examples<br />

You can map the :w command to the :up command as shown below.<br />

map :w :up<br />

You can map the :q command to :confirm q as shown below.<br />

:map :q :confirm q<br />

Display Defined maps<br />

Type :map to display all the defined maps as shown below.<br />

:map<br />

:write<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

:!cc % & ./a.out<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

120

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

Saved successfully!

Ooh no, something went wrong!