Personal Vim configuration and VIM learning notes

Source: Internet
Author: User

Vim has been learning for nearly two weeks. It is indeed a very powerful editor. I believe it will speed up text more quickly after a while.CodeEditing efficiency.

At ordinary times, I am mainly engaged in Web development. Based on the Asp.net platform, many HTML + CSS + JS + aspx files are edited. I have added some simple settings on the basis of the original settings:

 
Set nobksy onset aiset nuset Sw = 4 set Ts = 4

Corresponding:

The backup file is not automatically generated; the Code is highlighted; the Code is automatically indented; the equal sign is displayed; the tab is indented 4; and the tab distance is 4.

Of course, what I want most now is:

1. When the cursor is moved to an empty row, it is still in the same vertical line as the row;

2. When you enter <, the HTML Tag is automatically disabled.

Here are some of my vim learning records:

Set nobk -- disable automatic backup function set AI -- always enable auto indent autoindentset AI -- always enable auto indent set nu -- display row set Nonu -- remove row J move down K move up h move left l move right ^ The Beginning of the line $ the end of the line gg The first G: N -- jump to row n a insert the cursor and I insert the cursor before the cursor R replace the current character V and then the character v -- select the current position v -- select the current line ggvg -- select all content NNG -- jump directly to the NN line/-- find n -- look for the next n -- turn to the previous row number copy destination row -- copy and paste the start row, end line copy destination line number -- copy and paste row number move destination line number -- cut start line, end row move destination line number YY -- Copy current line P -- paste following current character p -- paste before current character start line, end line S/search content/replace content X -- delete a single character X -- delete the character NX before the cursor- -Row number D -- delete a row's start row and end row d -- delete multiple rows [m, n] S/source string/destination string/[Option] -- % indicates the entire file (same as 1, $ );: 2, 50 s/^/\/g -- in 2 ~ Add a comment at the beginning of 50 rows: s/\ // g -- Delete comment = -- indent once n = -- indent n insert times Ctrl-t -- right Ctrl-d -- left shrink command status> -- right contraction <-- left contraction n <-- left indent multiple lines n> -- right indent multiple lines set Sw = n -- set spaces for each layer indent shiftwidth set Ts = n -- the number of spaces occupied by a Tab character during editing tabstop. -- repeat the previous command: sq -- split the current window into two: New -- open a new window: On sets the current window as a unique window ~ -- Convert uppercase and lowercase ZF to create a fold. For example, in the marker mode: zf56g, create a code fold from the current row to 56 rows; 10zf, 10zf +, or zf10 fold, create Code folding from the current row to the last 10 lines. 10zf-or zf10 labels, create code folding from the current row to the previous 10 lines. At ZF %, create the matching brackets (), {}, [], <>, etc.) from the current row ). ZD Delete is the folding of the cursor. Valid only when 'foldmethod' is set to "Manual" or "marker.
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.