June 20 Task
5.1 Vim Introduction
5.2 Vim color display and move cursor
5.3 Vim General mode move cursor
5.4 Vim General mode copy, cut and paste
2018-04-18 17:55:31
Vim color display and move cursor
The same files may be available in different directories or not.
Look at the following example:
vim/etc/passwd
Copy/etc/passwd to/tmp/Open, there is no color
Then try adding a few lines of # comments, and the colors will be there. (GG first line, shift o can be transferred to the first row of the previous row and into the editing mode)
If you change the file name to passwd.sh, look.
So the color of the decision factors, such as change to. PY will be displayed according to Python rules
The address of the Vim configuration file is/ETC/VIMRC
General mode
Hjkl
Lower left top right
The space to the right number + space is to move to the right a few positions the same above HJKL also supports remembering numbers in front
CTRL B Turn backward on one screen
Ctrl f down one screen of the flip forward
Copy cut paste in general mode
DD is actually cutting this line
YY is copying this line
There's no good way to use it.
Go to edit mode now!
I enter edit mode
I (large i) enter edit at the beginning of the line where the cursor is located
o Start editing from the next line of the cursor
A (after) cursor so the character after the start of editing
A Enter the end of the line with I opposite
And finally, into command mode.
When replacing, G is the global meaning, replace all, otherwise it is only the first line found. In addition, the range must be real.
If the content to be replaced has/will conflict with the command. This can be done using the following methods:
Change the original/change to a different special symbol
: 1, $s ^love^pleased^g
: Nohl No high light does not highlight
: X Save exit similar to: WQ
The difference is that when viewed but not manipulated, Wq changes mtime x does not
In fact, there is nothing to say, is to practice more.
Phase 26 20180620 Vim