1. Command Collection
Multi-window operation
: SP File2
Then it's the window switch.
Ctrl+w--->j
Ctrl+w--->k
!command
Temporarily leave Vim, execute command temporarily, several forms
1):!command
Do not exit vim and execute shell command commands to display the command output in the VIM command area without altering the contents of the currently edited file
For example
:!ls-l
Special to run:!bash to launch a bash shell and execute commands without having to exit vim
2): R!command
The result of the shell commandinsert to the next line in the current row
For example
: R!date, reads the system time and inserts the next line into the current row.
3): Start line number, end line number!command
Enter the contents of the range specified by the start line and end line numbers into the shell command handler andprocessing Results Replace the contents of the range specified by the starting line number and ending line number
For example
: 62,72!sort, sorts the contents of rows 62 through 72
You can specify only the starting line, for example:!tr [A-z] [a-z], 62-line lowercase letters to uppercase
The current cursor line, in addition to specifying the line extra, you can also use., for example:. !tr [A-z] [a-z], the lowercase of the current line is capitalized
4): Start line number, end line number W!command
Enter the contents of the range specified by the starting line and end line numbers as the command.does not change the contents of the currently edited file
For example
: 62,72 w!sort, sorts the contents of rows 62 through 72, but the result of sorting is not directly exported to the currently edited file, but instead is displayed in the area of the vim knocking command.
Special can be used under this
: W!bash will execute the contents of line 62nd as a bash command and display the results without altering the contents of the currently edited file
The same:. W!bash, executes the contents of the current line as a bash command
For example, 52 lines of content is ls-l
So input: The!bash is the same effect as executing!ls-l, if you're using a shell that's a bash shell
If the input is:!bash, then the 52nd line of the contents of the ls-l as a command execution, and the output of the command will replace the 52nd line of content, note the difference.
Vim Learning Summary