Download vim and vim

Source: Internet
Author: User

Download vim and vim
Vim

Vim-related knowledge is accumulated and is continuously updated.

Common Key Mode
  • n1,n2s/word1/word2/gSearch for word1 between line n1 and line n2 and replace it with word2.
  • 1,$s/word1/word2/gSearch for word1 from the first row to the last row and replace it with word2.
  • N[Enter]Move n rows down
  • 0: Move to the last character of the row
  • $: Move to the first character of the row
  • G: Last line
  • Gg: First Line
  • X & X: x is equivalent to [Del], and X is equivalent to [Backspace]
  • Dd: delete this row
  • Yy: Copy this row
  • Nyy: Copy n rows down
  • P & P: p is pasted to the next row, and P is pasted to the previous row.
  • U: Restore the previous operation
  • /: Search
Switch to the command line
  • :! Command temporarily leaves the display result of Executing command
  • Set nu display row number
Environment Settings and records

There are many parameters set in the vim environment. If you want to know the current setting value, you can enterset allBut there are too many options to set. Here we will list some simple settings that are commonly used.

You can also use the configuration file to intuitively define the vim operating environment we are used. The overall vim setting value is generally placed in the/etc/vimrc file. However, it is not recommended to modify it directly. Recommended File Modification~/.vimrcThis file (which does not exist by default, please manually create it) and include the desired setting value.

Set hlsearch "High Brightness anti-white set backspace = 2" class at any time use the backspace key to delete set autoindent "automatic contraction set rshort" class shows the status of the last row set showmode "the status of the row in the lower left corner set nu "row number set bg = dark" show different background colors syntax on "syntax highlighting
Block Selection

When you press v, V, or [Ctrl]-v, the position where the cursor passes will start to be reversed. The y key can be copied, And the d key can be deleted.

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.