vim color display and move cursor
The same file in different directories may or may not have colors.
See the example below:
vim /etc/passwd
After copying /etc/passwd to /tmp/, there is no color
Then try adding a few lines of #comment, and the color will be there. (The first line of gg, shift o can be adjusted to the previous line of the first line and enter the editing mode)
If you change the file name to passwd.sh see
So there are many determinants of color, such as changing to .py, it will be displayed according to the rules of python
The address of the vim configuration file is /etc/vimrc
in normal mode
hjkl
left bottom top right
Space to the right number + space is to move a few positions to the right. Also the above hjkl also supports remembering the number in front
ctrl b scroll backward one screen at a time
ctrl f to scroll forward one screen at a time
Copy, cut and paste in normal mode
dd actually cuts this line
yy is to copy this line
there's no good way,
Enter edit mode!
i enter edit mode
I (big i) enters editing at the beginning of the line where the cursor is located
o Start editing from the line below the cursor line
a (after) start editing after the character where the cursor is
A goes to end of line and is the opposite of I
Finally, enter command mode
When replacing, g means global global, replace all, otherwise it is only found in the first line. In addition, the scope must be real and effective
If the content to be replaced has /, it will conflict with the / in the command. This can be used as follows:
Replace the original / with other special symbols
:1,$s^love^pleased^g
:nohl no high light
:x save and exit like :wq
The difference is that wq will change mtime x when viewing but not operating
In fact, there is nothing to say, just practice more.