Thursday, July 23, 2009

vi Editor Tips

TIPS:
vi - is a programmers text editor.

The editor can be used to create scripts or any type of file in Linux.

To try the below options, open a sample file.

$ vi samplefile.txt

Following are the short cuts used in vi editor:


Command :Result
Yy:to copy the current line
y3 and down arrow:to copy 3 lines below the current line
Dd:to cut/delete the current line
d3 and down arrow:to delete 3 lines below the current line
P:to paste the copied line
U:Undo last change
R:Redo last change
X:Delete character
Dw:Delete word
Q!:Quit without saving file
Ctrl f:Move forward one page
Ctrl b:Move backward one page

Thanks
A.T.J

No comments:

Post a Comment