Seventh Lesson-the first 07_01_vim editor
Text Editor: Edit plain ASCII documents, nano full screen editing, sed line processing, vim
Word processors: Word documents, WPS documents, etc.
1.VI Editor: Visual Interface Visual interface, Vi enhanced version is VIM,VI based on the addition of functional extensions to the plug-in form Vim,vi improved. is a full-screen modal editor.
1) vim/path/to/somefile Open File
Vim +n/path/to/somefile position the cursor directly to a row when opening the file, such as row n
The last line shows how many lines are in the open file, how many characters
VIM +/path/to/somefile cursor positioned at the beginning of the last line after opening the file
The lower right corner of the screen shows the 53,1 Bot, the cursor at the bottom of the file, the first character of line 53rd
Vim +/pattern file opens the document to the beginning of the line that was first matched to the PATTERN
2) Vim mode
Edit mode or Command mode, VIM opens after default mode
Input mode:
Last line mode: The final line of the entire screen, not the last line of vim. More commands than the edit mode supports
Edit mode, Input mode:
I switch to input mode before the current cursor character, insert
A is converted to input mode after the current cursor character, append
o Create a new row below the current cursor line and switch to input mode
I at the beginning of the line where the cursor is currently located and into input mode
A at the end of the line where the current cursor is located and into input mode
O Create a new row above the current cursor line and switch to input mode
Input mode, edit mode
ESC key in the upper-left corner of the keyboard
Edit mode, end-of-line mode (only edit mode can enter the last row mode, input mode must first return to edit mode and then enter the last line mode)
: Colon
Last-line mode, edit mode
ESC key, the key in the upper left corner of the keyboard, even hit 2 ESC
3) Close the file
Closing files in the last-line mode:
Q exit
Wq Save and exit
Q! Do not save and exit
W Save
W! Forcibly saved
X is Wq, the same effect.
To close the file in edit mode:
ZZ Save and exit
4) Move the cursor in edit mode
<1> move the cursor one character at a point: 4 arrows
H Left
L Right
J Down
K Up
5h,3j,6l,9k move a specified number of characters, preceded by a number
<2> move words one by one, moving in words
W move to the beginning of the next word
E moves to the ending of the next word, and if the cursor is not at the current word ending first jumps to the ending of the current word, and then moves to the ending of the next word when you press E
b move to the beginning of the next word, if at this point the cursor is not in the current word word first jumps to the beginning of the current word, and then press E to move to the beginning of the next word
3W,2E,4B move a specified number of words, preceded by a number
<3> in-line jump
0 jump to the beginning of the line, absolute line, the leftmost screen
^ Jump to the beginning of the line, the first non-whitespace character
$ jump to end of line, absolute line end, screen rightmost
<4> between rows jump
#G: 4G jumps to line 4th
G: Last line
42 minutes
Seventh Lesson-the first 07_01_vim editor