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

Mode<br />

Normal<br />

Insert<br />

Command Line<br />

Description<br />

The Vim editor starts in this mode,<br />

where you can execute all editor<br />

commands.<br />

This mode is for inserting text.<br />

This mode is for executing ex<br />

commands at the bottom of the editor.<br />

For example, :wq<br />

Let’s assume you want to create a helloworld.txt with the text “Hello<br />

World!”. The following steps explain how you do this with the help of these<br />

three modes.<br />

Step 1: Normal mode. Open the new file in Normal mode.<br />

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

Step 2: Insert Mode. Go to Insert mode, and type Hello World!<br />

i<br />

Step 3: Command Line mode. Go to command line mode and type :wq to<br />

save the file and exit the editor.<br />

:wq<br />

15

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

Saved successfully!

Ooh no, something went wrong!