Esc puts the vi editor into command mode. i begins insert mode at the current cursor position while I begins insert mode at the beginning of the line. Additional commands allow deleting characters, words, and lines, changing text, opening and closing lines, searching, substituting text, and navigating within a document. : commands allow quitting, writing to files, searching, substituting text across a range of lines, and setting options.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
112 views1 page
Vi Editor Commands
Esc puts the vi editor into command mode. i begins insert mode at the current cursor position while I begins insert mode at the beginning of the line. Additional commands allow deleting characters, words, and lines, changing text, opening and closing lines, searching, substituting text, and navigating within a document. : commands allow quitting, writing to files, searching, substituting text across a range of lines, and setting options.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1
Vi Editor commands:
Esc Command mode.
i Insert mode beginning at current cursor position. I Insert mode beginning of line. A Begin writing at end of line. R Overwrite mode. r Replace single character. x Delete single character. cw Change current word beginning at cursor. cW Change current word ignoring special characters. o open line below curser (insert mode). O open line above curser (insert mode). :q quit. :w write changes to file. :wq write changes and quit. :x write changes and quit. ZZ write changes and quit. :q! quit, lose changes. :wq! write changes and quit (use when file is write protected). dd delete current line. 5dd delete next 5 lines. dw delete word beginning at cursor. dW delete word beginning at cursor ignoring special characters. u undo last command. U undo changes on current line. D Delete from cursor to end of line. yy "Yank" current line into buffer. 5yy "Yank" five lines into buffer. p "Put" buffer onto line below cursor. P "Put" buffer onto line above cursor. :1 Go to line 1. :5 Go to line 5. 5G Go to line 5. G Go to end of document. H Go to top of current page. 0 Go to beginning of line. ^G (Cntrl g) Show current line number. $ Go to end of line. w Go to next word. W Go to next word ignoring special characters. /abc Search for lines with string "abc" /^abc Search for lines that begin with "abc" :%s/abc/DEF/ Substitute letters "abc" with "DEF" :%s/abc/DEF/g Global substitution. i.e. multiple occurrences on a line. :1,5s/abc/DEF/ Substitute letters "abc" with "DEF" lines 1 thru 5 only. :6,.s/abc/DEF/ Substitute letters "abc" with "DEF" line 6 thru current line. :6,$s/abc/DEF/ Substitute letters "abc" with "DEF" line 6 thru end of file. :%g/abc/d Delete all lines containing characters "abc". :%v/abc/d Delete all lines except those containing the characters "abc". :set Set various options. :!command Execute a command from the shell
Ultimate PowerShell Automation for System Administration: Streamline Automation and Administration Tasks with Advanced PowerShell Techniques and Expert Insights (English Edition)