Note content:
L 5.5 into edit mode
L 5.6 VIM Command mode
L 5.7 Vim Practice
Note Date:2017.8.4
5.5 into edit mode
The so-called editing mode is to enter the state of the contents of the file can be edited, and into the word document into Notepad is the same, the most common way to enter the editing mode is to press I, This is the edit mode that enters the current cursor position. Here are a few ways to enter edit mode:
Shift+i can also enter edit mode, but the cursor moves to the beginning of the line where the cursor is located.
pressing the O key will change the line and enter edit mode.
Shift+o is entered in edit mode after a line is changed.
Press a to enter edit mode after the current character is moved one after the other.
The shift+a cursor moves to the end of the line where the cursor is located and enters edit mode.
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/A7/1B/wKioL1ngkqLidrPZAAbhN4j-Z-0474.png "style=" float : none; "title=" vim edit mode, command mode and practice using 294.png "alt=" Wkiol1ngkqlidrpzaabhn4j-z-0474.png "/>
5.6 VIM Command mode
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A7/1B/wKioL1ngkqiD2-XDAAwhtNCkbK0410.png "style=" float : none; "title=" vim edit mode, command mode and practice using 308.png "alt=" Wkiol1ngkqid2-xdaawhtnckbk0410.png "/>
:%s/str1/str2/ replaces the first occurrence of a string in a row with a string str2 str1
: s/str1/str2/g replaces all occurrences of a string in a line with a string str2 str1
: ., $ s/str1/str2/g Replaces all occurrences of the body's current line to the end with a string str2 str1
: 1,$ s/str1/str2/g Replace all occurrences of string s in the body with string str2 TR1
: g/str1/s//str2/g function Ibid .
: M , ns/str1/str2/g replaces str1 from m rows to n rows with str2
From the Replace command above you can see:
The G is placed at the end of the command to replace each occurrence of the search string, not just the first occurrence in each row, and no G, to replace only the first occurrence of the search string; G at the beginning of the command to replace all rows in the body that contain the search string
s indicates a command followed by a string of replacements
% indicates that the replacement range is all lines, that is, full text
X save exits are similar to Wq, where the difference is that using WQ without manipulating the file changes mtime, using the x is not changed Mtime , unless you are working on the file.
5.7 Vim Practice
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/08/64/wKiom1nglWLTOpKcAAkDrlzOeS8202.png "style=" float : none; "title=" vim edit mode, command mode and practice using 822.png "alt=" Wkiom1nglwltopkcaakdrlzoes8202.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/A7/1B/wKioL1ngkrCQtTvOAAdxQbzgvUQ961.png "style=" float : none; "title=" vim edit mode, command mode and practice using 825.png "alt=" Wkiol1ngkrcqttvoaadxqbzgvuq961.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/08/64/wKiom1nglWmAQPtWAAYZu4b2aEI438.png "style=" float : none; "title=" vim edit mode, command mode and practice using 828.png "alt=" Wkiom1nglwmaqptwaayzu4b2aei438.png "/>
Extended:
special usage of vim http://www.apelearn.com/bbs/thread-9334-1-1.html
Vim Common shortcut key summary http://www.apelearn.com/bbs/thread-407-1-1.html
Vim quickly deletes a character http://www.apelearn.com/bbs/thread-842-1-1.html
Vim garbled http://www.apelearn.com/bbs/thread-6753-1-1.html
Small keyboard problem http://www.apelearn.com/bbs/thread-7215-1-1.html
Vim encryption http://www.apelearn.com/bbs/thread-7750-1-1.html
This article is from the "12831981" blog, please be sure to keep this source http://12841981.blog.51cto.com/12831981/1972190
Enter edit mode, vim command mode, VIM practice