Common shortcuts in the command mode of the 1.vim editor
Command function
DD Delete (cut) the entire line where the cursor is located.
5DD Delete (cut) 5 lines starting at the cursor.
YY copies the entire line where the cursor is located.
5yy Copies the 5 lines starting at the cursor.
P Pastes the previously deleted (DD) or copied (yy) data into the cursor.
/String to search for the string from top to bottom in the text.
The string is searched in the text from bottom to top of the string.
N Displays the next string that the search command navigates to.
N Displays the previous string to which the search command is anchored.
U undo the last step operation
Common commands in the last-line mode of the 2.vim editor
Command function
: w Save
: Q exit
: q! Force quit (discard modifications to the text)
: wq! Force Save exit
: Set nu displays line number
: Set Nonu does not display line numbers
: Command to execute the command
: integer jumps to the row
3. File test: [operator file or directory name]
Operator Action
- D test is a directory.
- E tests whether a file or directory exists.
- F to determine whether the file is.
- R tests whether the current user has permission to read.
- W tests whether the current user has permission to write.
- x tests whether the current user has permission to execute.
4. Logic test: [expression 1] operator [expression 2]
Operator Action
&& logical with, "and" meaning.
|| The meaning of logic or, "or".
! Logical No.
5. Integer value comparison: [Integer 1 operator integer 2]
Operator Action
-eq judgment is equal to
-ne judgment is not equal to
-GT Judging whether it is greater than
-lt Judging whether it is less than
-le judgment is equal to or less than
-ge judgment is greater than or equal to
6. String comparison: [string 1 operator String 2]
Operator Action
= compares string contents to the same.
! = compares string contents differently.
- Z Determines whether the string contents are empty.
This article is from the "Linux Learning path" blog, so be sure to keep this source http://10243875.blog.51cto.com/10233875/1823616
Characters commonly used in shell scripts and shortcut keys in the VIM editor