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

* Vi / Vim Tips and Tricks<br />

* Linux Tutorials<br />

* SSH Tips and Tricks<br />

* Productivity Tips<br />

* HowTo & FAQ<br />

* Hardware Articles<br />

* Nagios Tutorials<br />

* MySQL and PostgreSQL Tips<br />

Bonus Hack 2. Set Vim as Universal Default Editor<br />

using update-alternatives<br />

If you are a system administrator, you may want to set Vim as default editor<br />

for the whole system. Use update-alternatives as shown below. This works on<br />

all Debian based system.<br />

# update-alternatives --set editor <br />

Bonus Hack 3. Make Vim as Default Editor<br />

You can set Vim as default editor as shown below.<br />

$ export EDITOR=vi<br />

Most of the Unix applications (For example, crontab) refer this EDITOR<br />

variable to check which editor can be used. So it is better to set this in your<br />

bashrc<br />

157

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

Saved successfully!

Ooh no, something went wrong!