The Vim learning of Linux

Source: Internet
Author: User

Vim is divided into three modes: General mode, edit mode, command mode

1. General mode

General mode can move cursor, delete, paste copy and other operations
Move Cursor Action


Search and replace


Delete, copy and paste on

2. Edit mode

General mode switch to edit mode

3. Command-line mode
w:写入wq:保存后离开q!:不存储离开w [filename]:另存为filenamer [filename]:将filename这个文件的内容加到光标所在行的后面n1,n2 w [filename]:将n1行到n2行的内容另存为filename文件!command:暂时离开vim到指令下查看commmad执行的显示结果,如!ls /home 即可在vim下查看/home下的输出信息set nu:设置数字set nonu:与上向反
4. Additional features of Vim 1. Block selection See

2. Multi-file editing

Vim can open several files at the same time, the content of one file can be effectively assigned to another file

3. Multi-Window function
sp {fielname}:开启一个新窗口,如果有加filename,表示在新窗口中加入一个新文件;否则表示两个窗口为同一个档案显示(同步显示)其中filename要是不填写的话,则同一个文件出现在两个窗口ctrl+w+↓(j):窗口向下移动,先按下ctrl+w,然后按下j即可ctrl+w+↑(k):...

It is really convenient to copy and consult.

4.vim environment Setting and logging: ~/.vimrc,~/.viminfo

The ~/.viminfo file automatically generates and records your actions in Vim.

Vim common environment settings see

Common configuration file to specify the VIM operating environment, the overall Vim setting value is in the/ETC/VIMRC file, but not recommended modification, you can modify the ~/.VIMRC this file (if it does not exist, can be created by itself)

The Vim learning of Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.