Vim text Compiler
VI is the default text compiler for Linux and Unix, and Vim is the enhanced version of VI
1, about Vim, there are three modes
Command mode: The default mode after the file is opened, can only view the contents of the file cannot be modified
Input mode: can edit and modify
Last-line mode: Used to save changes and exit
2. Switch
Command mode = = "Input mode press I key
Command mode = = "last line mode" Press: Key
Input mode and last line mode = = Command Mode press ESC
3. Vim filename (filename)
Open this file if filename is present
Create this file if filename does not exist
Experiment:
1. Create a new file in the/root/directory hello.sh
1.1, input content "Hello World!!!" ”
Press I into input mode after entering command mode
Notice the word "insert" below, which is the symbol for the input pattern.
1.2. Use cat command to confirm file contents after saving
2. Modify the System file/etc/hosts
2.1. Add a line at the end "127.0.0.1 www.baidu.com"
2.2. Use the ping command to test the connectivity of the www.baidu.com and observe the results
Some basic applications of VIM