Linux Eighth session
--------------------------------------------------------------------------------------------------------------- ------------------------------------
42. VIM Basic Concept
Vi:visual Interface, Text editor
Text editing type: line editor: sed, full screen editor: Nano, VI
Vim-vi improved, an upgraded version of the Vi editor
Other editors
Gedit A simple graphical editor that gvim a graphical version of the Vim editor, both of which need to be created in graphical mode.
Vim + Number: The Vim editor jumps directly to the number line after opening the file
vim+ Regular expression: When you open a file, leave the cursor at the beginning of the first line that matches the regular expression
–B file binary mode open files
–d file1 file2 ... Compare multiple Files
-m file read-only open files
Ex file or vim–e directly into ex mode
If the file exists, the file is opened and the content is displayed
If the file does not exist, create it when you save it for the first time after editing
43. Three modes of VIM editor
Three main modes:
Command (Normal) mode: The default mode, move the cursor, cut/paste text, the screen only the cursor flashing;
Insert (insert) or edit mode: Modify text with insert at the bottom of the screen
Extended commands (Extended command) mode: Save, exit, etc., below the screen is:
ESC key to exit the current mode
ESC key always returns to command mode
Extended mode:
: Q exit
: q! Force exit, discard the modifications made
: Wq Save Exit
: X Save exit
Command mode
ZZ: Save exit
ZQ: Do not save exit
44. Extended Mode key operation
Press ":" to enter the extension mode and create a command prompt: On the left side of the screen at the bottom
Command:
W Write (Save) disk File
Wq Write and exit
X Write and exit
Q exit
Q! Do not save the log out, even if the changes are lost
R filename reads the contents of the file into the current file
W FileName writes the current file contents to another file
!command Execute command
R!command read-in command output
Linux eighth session-vim editor