VIM basic commands and personal configuration

Source: Internet
Author: User

Tag: Pos Post search detects down art ble MRC consistency

VIM basic Commands
    • Cursor movement

G last line
NG moves to nth row n return cursor moves down n rows
GG First Line

    • Find and replace

/word
n Repeat previous Find operation N search up
: n1,n2s/word1/word2/g from line N1 to section N2 find N1 replace with N2 last behavior $

    • Delete, copy and paste

X,x backward Delete [del], forward delete [BACKSPACE] NX Continuous Delete n
DD Delete Row ndd down n row DGG from the cursor to the first line DG Delete to the last line D0 from the cursor to the beginning of the line D\ (from the cursor to the end of the line yy copy row Nyy Ygg yG y0 y\)
P,p copy backward, copy forward
U undo

    • Edit mode

where I am inserted
A next character insert
o Insert Next line
R replaces once R has been replaced

    • Block selection

[Ctrl]+v block selection

    • Multi-file editing

: Files lists the file that is currently open
: n n the next file n Previous

    • Multi-window

: SP filename Opens the file in a new window
[Ctrl]+w Switch window

    • Personal VIM Profile

      Configuration file in ~/.VIMRC

"显示行号set nu"语法高亮syntax on"大括号补全inoremap { {}<ESC>i<CR><ESC>V<O"使用vim的键盘模式"set nocompatible"不需要备份set nobackup"没有保存或文件只读时弹出确认set confirm"鼠标可用set mouse=a"tab缩进set tabstop=4set shiftwidth=4set expandtabset smarttab"文件自动检测外部更改set autoread"c文件自动缩进set cindent"自动对齐set autoindent"智能缩进set smartindent"高亮查找匹配set hlsearch"背景色set background=dark"显示匹配set showmatch"显示标尺,就是在右下角显示光标位置set ruler"去除vi的一致性set nocompatible"不要闪烁set novisualbell"浅色显示当前行autocmd InsertLeave * se nocul"用浅色高亮当前行autocmd InsertEnter * se cul"显示输入的命令set showcmd

VIM basic commands and personal configuration

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.