Saturday, May 11, 2013

Quick Linux (7): Little VIM

I didn't read the whole chapter, I just focused on few things I need right now:


Open VIM:
$vim +n filename        #Edits filename starting at line n
$vim + filename         #Edits filename starting at the last line
$vim +/pattern filename #Edits filename starting at the first line containing pattern
vim –r filename         #Recovers filename after a system crash
$vim –R filename        #Edits filename readonly (same as opening the file with view

Adding text:
i #before cursor 
I #before first non-blank character
a #after cursor
A #at the end of line
o #adds line below current line
O #line above current line
r #replaces current character
R #replaces characters starting with current character

No comments:

Post a Comment