VIM Operation Daquan

Source: Internet
Author: User

Vim a.txt Open a file a.txt

Enter some text into vim

Enter vim or the command state must press I "" I a A or isert to enter the editing state

Save Exit Esc Enter command status input : EQ Save exit

Do not save forced exit: q!

Set Nu sets line number





/xx Find xxx, press N to find the next, press N to find the previous one.


? text find text, reverse lookup, press N to find the next, press N to find the previous one.


There are some special characters in vim that need to be escaped when searching. *[]^%/?~$


: Set ignorecase ignores case-finding


: Set noignorecase does not ignore case-finding


Look for long words, if a word is very long, type trouble, you can move the cursor to the word, press the * or the # key to be able to search the word, equivalent/search. and the # command corresponds to a search.


: Set Hlsearch Highlight search results, all results are highlighted instead of just one match.


: Set Nohlsearch Close Highlight search display


: Nohlsearch turns off the current highlight, and if you search again or press N or N, it will be highlighted again.


: Set Incsearch stepwise search mode to search for characters that are currently typed without waiting for typing to complete.


: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.




U undo (undo)

U undo the operation of the whole row

Ctrl + R Redo (Redo), that is, undo revocation.


Delete command


X Delete Current character


3x Delete current cursor start backward three characters


X deletes the previous character of the current character. X=dh


DL Delete current character, dl=x


DH Deletes a previous character


DD Delete When moving forward


DJ Delete Previous Line


DK Delete Next Line


10d deletes 10 rows from the beginning of the current line.


D Delete the current character to the end of the line. d=d$


d$ Delete all characters after the current character (bank)


KDGG all rows before the current row is deleted (excluding the current row)


JdG (JD Shift + G) deletes all rows after the current line (excluding the current row)


: 1,10d Delete 1-10 rows


: One, $d delete 11 rows and all subsequent rows


: 1, $d delete all rows


J (Shift + J) Deletes a blank line between two rows, in effect merging two rows.


VIM Operation Daquan

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.