I. Introduction of VIM
Vim is an upgraded version of VI
is the vi with color display
Divided into general mode, edit mode, command mode.
yum install -y vim-enhanced
Install Vim
Use VIM to open passwd after installation is complete
vim /etc/passwd
And before with the VI open there are obvious differences, vim with color display,
Second, Vim color display and move the cursor
Move the/etc/passwd to/tmp
vim/tmp/passwd
Found and no color display
Vim color display is related to file's path, file content
Vim/etc/vimrc
You can edit vim's configuration file,
First we find a file to practice vim
cp /etc/dnsmasq.conf /tmp/1.txt
I am suggesting here that the/etc/dnsmasq.conf file does not exist,
Run the above command after installing DNSMASQ, and then copy the file
And then
vim /tmp/1.txt
First enter the number and then the arrow key can move the n characters left or right or move n rows up or down
U is redo last operation, up to 50 times
Ctrl+r is an anti-recovery, such as multiple press of U, you can use Ctrl+r to restore the next operation
V can move the cursor to select the copied range, X can be cut, and then paste with P
Linux Learning Notes (17) Vim