Linuxcenos installing VIM-related operations
1. Software Installation: Yum install-y vim
2. Working mode
-1. Normal mode
1) primarily used to browse or modify text content
2) Use VIM to open the default mode of the file
3) Press the ESC key in any mode to enter
-2. Edit mode
Used primarily to add content insertion mode to text
Normal mode Enter the following characters to enter
I: Start entering text before the character of the cursor
I: Enter text at the beginning of the first non-whitespace character at the beginning of the line
A: Enter text after the cursor character
A: Enter text at the end of the line
O: Enter a number in a separate row below the cursor line
O: Enter a number on a separate line above the line on which the cursor is located
S: Delete the character of the cursor and enter insert mode
S: Delete the cursor line and enter insert mode
3. Open File
Vim filename Opens the file and positions the cursor at the beginning of the file
1. If the file already exists, open it directly
2. File does not exist re-establish the file (do not modify the file will not be created)
Vim filename +n Open file with cursor positioned to n rows
Vim filename + Open file, cursor positioned to end
4. Cursor positioning
GG: First line
GG: Last line
NGG: Nth Row
0: Beginning of the line
^: first non-null character
$: End of line
K: Up
J: Down
H: Left
L: Right
5. Copy and paste
YY: The copy cursor is in the row
DD: The clipping cursor is in the row
P: Paste the contents of the buffer
Nyy: The n line at which the copy cursor begins
NDD: Cut
6. Operation Fallback
U: Undo just the action
Ctrl+r: Anti-revocation
File processing naming
1. File content View
Cat
Function: Display all contents of a file in one order
Format: Cat file
Tac
Action: One-time flashback shows all the contents of a file
Format: TAC File
Head
Action: Displays several lines of content at the beginning of a file
Format: Head-n file n is the number of rows to display
Tail
Action: Displays several lines of content at the end of a file
Format: Tail-n file n is the number of rows to display
More
Role: Pagination shows the results of other command executions
Format: Other Commands | More like: Cat file | More
Description
Stop when content displays one screen
Space Page DOWN (only down)
Enter a line down
Q Key to exit
Less
Role: Pagination shows the results of other command executions
Format: Other Commands | Less: Cat file | Less
Description
Same as more command up and down a row
More and less front can be a lot of query search etc command ls find
Rights Management Commands
Vim text editing