Vim Text Editor

Source: Internet
Author: User
vim编辑器三种工作模式: 命令模式 输入模式(插入模式) 末行模式 1, 光标跳转 Home 键、数字 0 跳转至行首 End 键 跳转到行尾 PgUp 键、PgDn 键 向上翻页、向下翻页 1G 或 gg 跳转到文件的首行 G 跳转到文件的末尾行 2,复制/粘贴/删除 yy、4yy 复制光标处的一行、4行 p 粘贴到光标处之后、之前 x 或 Delete键 删除光标处的单个字符 dd、6dd 删除光标处的一行、6行 d^ 从光标处之前删除至行首 d$ 从光标处删除到行尾 C 从光标处删除到行尾,并且进入 输入模式 3,查找/撤销 /root 向后查找字符串“root” n、N 跳至后/前一个结果 u 撤销最近的一次操作 Ctrl + r 取消前一次撤销操作 4,字符串替换: :s/root/admin 替换当前行第一个“root” :s/root/admin/g 替换当前行所有的“root” :1,8 s/root/admin/g 替换第1-8行所有的“root” :% s/root/admin/g 替换文件内所有的“root” 5,开关参数的控制: :set nu|nonu 显示/不显示行号 :set ai|noai 启用/关闭自动缩进 6,退出命令: :wq 保存并退出 ZZ 保存并退出 :q! 强制退出并忽略所有更改 :e! 放弃所有修改,并打开原来文件 7,读入其他文件内容 :r /etc/filesystems

Vim Text Editor

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: 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.