Vim Common Commands Summary

Source: Internet
Author: User

Vim Common Commands Summary

.-You can let us repeat the last Operation command y-Copy the command. It can be followed by a displacement, or an object selection. For example it's actually with C-The Cut command is very similar yaw-copy a word, including the preceding space Yiw-Copy a word that does not include the preceding space Y-copy a row of content y+k-copy cursor line followed by line t-Search command, cursor jumps to character before T-Reverse Search command, cursor jumps to Word match either F-Search command, the cursor jumps to the character F-Reverse Search command, the cursor jumps to the character;-can jump to the next search results when we use the copy and delete commands, if the object is followed by [], {}, and so on, their operation scope is the contents of this parenthesis, for example, {AAAA}, when we put the cursor on {, let us execute yi{after the time, We're actually copying AAAA.<c-r>+ Register-Copy the contents of the register for example, you copied the current line with YY and then you can use the<c-r>+to copy it. Command line Common directives: [Range] Delete [x] Delete the specified row to register X:[range] Yank [x] Copy the specified row to register X:[line] put [x] copy the X register contents to the next line of the specified line. : [Range] copy [address] copies the contents of the specified line to the next line at the specified address: [Range] move [address] cuts the contents of the specified line to the next line of the specified address: [Range]JoinThe content of the specified line is consolidated into one line, that is, the line break is removed, and so on. Similar to J: [Range] normal [command] executes the command within the specified line, for example, if you do:1,3Normal A; Then you'll see 1,2, 3 lines, plus one at the back;: [Range] Substitute/{pattern}/{string}/{flags} Parrern in the specified line, in accordance with the flags standard, with string: [Range] Global/{pattern}/{cmd} to match Parrern line in the specified line, execute cmd command Q: Bring up the ex Command history table: The shell enters the shell terminal, and when we press exit again, we return to VIM:![cmd] execute cmd command: Read![cmd] execute cmd command: [Range]Write![cmd] input range as cmd command: Set spell on check spelling z=provides change suggestions for the word where the cursor is located set Spelllang=en this statement means that the grammar is spelled by default in English:W!sudo Tee%This command is useful when we need to save the changes to the article with root privileges: Earlier 1m back to the state before the article 1m: later 1m back to post 1m state: \ze[string] It means to satisfy the following string such as AAA BBBAAA CCC then we perform a search:/Aaa\ze CCC. This time the search result is AAA CCC instead of AAA Bbbmatchit.vim plugin This plugin is used to extend%match, follow vim release, but by default, we can add the following in. VIMRC to open it runtime macros/Matchit.vim This time, if we open an HTML file, the content is as followswe put the cursor on the first line of HTML, and then%, you can jump to/on the HTML. Surround.vim Plugin This plugin is used to add separators to the selected text. Like AAAAA then you select it and then execute S", the character will become"Aaaaa"Https//Github.com/tpope/vim-surroundVim-visual-star-Search.vim Plug-in this plugin can be selected in the mode of the content, as the keyword to find the address https://Github.com/nelstrom/vim-visual-star-searchFor example AAA BBB you want to search"a B", you can use the visual mode to select a B, and then x to find the

Vim

Summary of common commands for VIM

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.