A little cheat on VI

 

VI stands for VISUAL, it’s a very easy to use text editor. 

So, here are some most commonly used commands:

i      insert

a     append

x     delete a character at the current cursor

dd    delete a line

[colon]w     write buffer to file 

[colon]x!     write buffer to file and exit

[colon]q!      do not write buffer to file and exit

/abc     search the string ‘abc’ forward

?abc     search the string ‘abc’ backward

For more, just check Advanced Vi Cheat Sheet.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s