VIM shortcut Key-summary & custom Key

Source: Internet
Author: User
VIM shortcut Key-summary & amp; custom Key to avoid ambiguity arising from the number input command, use the following prompt to replace it. help: help shortcut help: the purpose of the helpc_CTRL-A shortcut in c mode, prefix I, v, c represents insert, visible, command mode. Command count: count... VIM shortcut Key-summary & custom Key to avoid ambiguity caused by the number input command, use = to replace the following prompt. help: help shortcut Key help: the purpose of the help c_CTRL-A shortcut in c mode, prefix I, v, c represents insert, visible, command mode, respectively. Command count: number + command, repeated N operations, for example: 3 k move up 3 lines, 3x 3a! Insert three exclamation mark tags to move: JKHL to move quickly, compare terminal shortcut key: move to the first word of the previous word B to the first w of the next word, move 3 words 3 w <---- B w ----> w/B is moved in the word header, moving at the end of a word is ge/e <---- ge e ----> if it is an uppercase string of B, W, gE, E, then only "space" is used as the word separator, for example, 'gloal. member is treated as a complete word. ^ Move the cursor to the beginning of the line $ move the cursor to the end of the line fx move the cursor to the next x, 3fx move the cursor to the third x move the Fx cursor to the front x tx, Tx is similar, ma marks the current row before moving to x. The label can be any character of a-z. 'A jumps to the tag. Label jump C-] jump back to C-O or C-T or ''ctrl + left/right-click can also jump/return jump to matching bracket % move to file first gg funny command 9999 k also move move the first part of the file to the end of the file to jump to line 33G in line 33rd or enter: 33. you can also jump to % liquid motion. for example, you can directly enter 1/3 zz to move the row where the current cursor is located to the center of the screen. The ZZ in ps capital is to save and exit the document. The row where the current zt cursor is located moves to the top of the screen. Note t = top. Zb moves the row where the current cursor is located to the bottom of the screen. Note B = bottom. H, M, and L are the positions that move to the head, middle, and last of the document respectively. C-F, C-B turning forward and backward Linux Terminal (Terminal) commonly used shortcut key ctrl + f move one character forward ctrl + B move one character alt + f move one word forward alt + B move one word backward ctrl + a move to the beginning of the current line ctrl + B + e move to the end of the current row, tags, edit c, the characters deleted by d and x are still in the register and can be pasted with p. C = replace (change), delete the text and enter the insert mode; d = delete (delete), usually used in combination; y = Copy (yank), p = paste (paste ); x = delete characters; delete, cut, copy a row = cc, dd, yy delete, cut, copy multiple rows = 3cc, 4dd, 5yy delete, cut, copy to the end of a row = c $, d $, y $, or uppercase C, D, Y, also to the end of the row. delete, cut, copy to the beginning of the line = c ^, d ^, y ^ or c0, d0, y0 start from the cursor, delete, cut, copy to the end of the word = cw, dw, yw deletes, cut, and copies the entire word = caw, daw, and yaw. Note the difference between yw and yaw. for example, if the cursor is in the e position of "test", yaw copies the entire word, and yw only copies est. Delete line breaks (merge two rows into one row): J undo last operation (restore): u undo (ReDo): C-R undo all operations on one row (restore one row): U, the second U operation will be revoked. Only u and C-R can return to any operation status. In visual mode, U/u is case-insensitive. O or O insert the text above or below the current row before the cursor = I insert after the cursor = a line first insert = I line end insert = A another line under the current row, and enter the insert state o start another row before the current row, and enter the insert state OCTRL-T is working with tags stackCTRL-O is working with jumplistTag stack and jumplist are different list in vim, but they might have same items when you jumping through tags (eg. using CTRL-]) tags external program paste/cut/copy GVIM's "+ register" can be copied/pasted with external programs: copy "+ y paste" + p cut "+ x note: The preceding shortcut keys are valid in command visual mode/mode. Press double quotation marks to enter register mode, and then press the plus sign, then press y/p/x in insert mode, Press ctrl + R to enter the register mode ("number will appear), and then press the corresponding register number. The system shared register number is +. in normal VIM mode, ctrl + r is redone. Tags multi-file buff (buffer) operation: edit filename edit file;: e main. c. same as above;: ls: list all buffer;: b2: disable buff = 2; bn: delete file buffer (close file ). Zz, ZZ, and q! Usage: zz places the edit row in the middle of the screen. ZZ save and exit.: Q! Do not save exit: wq save exit tags search and replace: set ignorecase: set noignorecase/include forward search, n next, N last? Include reverse search set non-circular search: set nowrapscan /\ Full-term match: Search for the word "the", starting with "\ <, ending with" \> # Search for matched words backward, * Search for matched words forward, gd is similar to the "*" function. tags regular search/^ the Search for the beginning of the line (for the row, not the word)/here $ search for the line number at the end of here to match any single character, if the content to be searched contains a vertex, use \. for example,/. search for "the" matched content/\. search for ". "matching content tags visual mode shift + v: row selection mode Capital V: the same as the selected area is converted to capital U, converted to lowercase ux and d are deleted in visual mode> and <在可视模式为右移,左移 tags 常用组合键删除光标到行结尾 开头="y$"    d^复制光标到行结尾  y^复制单词="yaw剪切单词=" daw tags 代码折叠可以zf进行折叠, 用zo打开折叠,也可以方向键向右打开折叠,zc 关闭折叠. tags 自定义快捷键inoremap ii Double-click the insert mode to enter the insert mode. in the insert mode, click the left button to enter the command mode. drag and drop the visual mode. map "+ Y" plus sign register-copy map "+ P" plus sign register-copy map "+ X" plus sign register-copy map : W "Save the cssag shortcut key, ctrl + \ +: cs find s xxx: cs find g xxx search function definition, similar to the tags ctrl +]: cs find t xxx global search string: cs find c xxx is similar to egrep: cs find c xxx to find all function calls. Note that cssag search cannot be in visual selection mode.
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.