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

$ cd ~/.<strong>vim</strong>/plugin<br />

$ wget<br />

http://www.<strong>vim</strong>.org/scripts/download_script.php?src_id=6<br />

504<br />

Enable the plugin by adding the following line to the ~/.<strong>vim</strong>rc<br />

$ <strong>vim</strong> ~/.<strong>vim</strong>rc<br />

filetype plugin on<br />

Two methods to Enable Auto Complete Plugin<br />

Method 1: Enable on an on-demand basis.<br />

This is probably the better method, as you can enable the auto completion<br />

mode only when you need it. Once you’ve opened a file, execute : call<br />

DoWordComplete() – to enable this plugin temporarily.<br />

$ <strong>vim</strong> mystory.txt<br />

: call DoWordComplete()<br />

Method 2: Enable by default<br />

$ cat ~/.<strong>vim</strong>rc<br />

:autocmd BufEnter * call DoWordComplete()<br />

Once you have this plugin enabled by default, if you would like to disable it<br />

temporarily you can do the following.<br />

153

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

Saved successfully!

Ooh no, something went wrong!