2018-02-28 Amin Linux Learning

Source: Internet
Author: User
5.5 Entering edit mode

I enter edit mode at the cursor position
I Enter edit mode at the beginning of the cursor position
o Insert a new row into edit mode with the row below the cursor line
O insert a new row into edit mode on the line where the cursor is located
A in the current word specifier insert
A at the end of the line where the cursor is inserted

5.6 VIM Command mode

/word     向光标之后查找一个字符串word ,按n向后继续搜索?word    向光标之前查找一个字符串word,按n向前继续搜索:n1,n2s/word1/word2/g    在n1-n2行之间查找word1并替换为word2,不加 g 则只替换每行的第一个word1:1,$s/word1/word2/g     将文档中所有的word1替换为word2,不加 g 则只替换每行的第一个word1:w     保存文本:q     退出vim:w!    强制保存,在root用户下,即使文本只读也可以完成保存:q!    强制退出,所有改动不生效:wq    保存并退出:set nu  显示行号:set nonu  不显示行号:nohl    取消高亮:x     修改内容后功能等同于 :wq ,如果没更改内容,会改变文件的mtime

5.7 Vim Practice

2018-02-28 Amin Linux Learning

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: info-contact@alibabacloud.com 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.