[Vim editor]

Source: Internet
Author: User

[2016-04-12] [Vim common Commands]
  
 
  1. Esc //退出编辑模式
  2. i //进入编辑模式,光标停留在当前位置
  3. o //进入编辑模式,在当前行之后新建一行,光标停留在新行行首
  4. dd //删除当前光标所在行,在命令前加数字可以删除多行,如 5dd 将删除从当前行开始向下5行
  5. yy //复制当前光标所在行,在命令前加数字可以复制多行,如 5yy 将复制从当前行开始向下5行
  6. p //把复制的内容粘在当前行下面,大写的P就粘上面
  7. gg //跳到文件第一行
  8. u //撤销
  9. gg=G //规范缩进
  10. :w //保存
  11. :q //退出
  12. :q! //不保存强制退出
  13. :%s/old/new/g //搜索整个文件,将old都替换成new,old和new是字符串
[2016-04-16] [VIM configuration information]
    • Modify the ~/.VIMRC file
    • The last IF-ENDIF statement is to set the vertical line of the cursor to Windows
  
 
  1. syntax on
  2. set tabstop=8
  3. set softtabstop=8
  4. set shiftwidth=4
  5. set cindent
  6. set nu
  7. if has("autocmd")
  8. au InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
  9. au InsertLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
  10. au VimLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
  11. endif


From for notes (Wiz)

[Vim 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.