0% found this document useful (0 votes)
17 views

Vi Editor Commands

The document summarizes commands for the VI text editor. It outlines commands for entering and exiting modes, cursor movement, changing and replacing text, deleting text, undoing changes, copying and pasting text, and saving and exiting files. Key commands include ESC to enter command mode, i to insert text, j/k to move down/up lines, dd to delete lines, u to undo, yy to copy lines, and :w to save changes.

Uploaded by

Ganesh Rj
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Vi Editor Commands

The document summarizes commands for the VI text editor. It outlines commands for entering and exiting modes, cursor movement, changing and replacing text, deleting text, undoing changes, copying and pasting text, and saving and exiting files. Key commands include ESC to enter command mode, i to insert text, j/k to move down/up lines, dd to delete lines, u to undo, yy to copy lines, and :w to save changes.

Uploaded by

Ganesh Rj
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

VI Editor COMMANDS: 1) esc to move from the edit mode to command mode 2) INPUT COMMANDS: a space append after

the cursor A append at the end of the line i insert before cursor I insert before 1st non-blank on the same line o open and insert at line below O open and insert at line above 3) CURSOR MOVEMENT COMMANDS: j line down k line up l character right h character left w word right b word left e end of word $ end of line ^ beginning of line G go to the last line nG go to line number n H go to top of the screen M go to middle of screen L go to last line on screen ) go to next sentence ( go to previous sentence ] go to next paragraph [ go to preceeding paragraph ^f go to next screen ^b go to previous screen ^d go to next half screen ^u go to previous half screen ^l go to re-draw screen 4) CHANGE AND REPLACE COMMANDS r replace character R replace till esc is pressed CW change word CC change line SW substitute word

5)

DELETE COMMANDS x delete a character nx delete n characters dw delete word ndw delete n words dd delete line ndd delete n lines D delete till end of line ^D delete till beginning of line d/pat delete up to pattern pat d?patdelete back to pattern pat d; delete to end of sentence d( delete to beginning of line d{ delete to end of paragraph UNDO COMMANDS U undo last operation u restore the changes made to current line nP undo retrieve n last delete YANK AND PUT COMMANDS yy or Y copying the line N nyy or NY to copy n lines into memory nyw to copy n number of words in memory yw to copy single word from a line p puts the copy contents below the cursor P put the copy contents above the cursor SAVE AND EXIT COMMANDS :w save changes :x exit saving changes ZZ save and exit :q quit without saving :q! quit discarding changes :!<command> running shell from vi :!! Repeat last command

6)

7)

8)

You might also like