When you perform some repetitive commands in vim, you can replace them with some shortcut keys. List below
After you edit the text and exit to normal mode, . repeat the last change operation, and if you press it more than once . , we can use
As in the following section of codeWe are going to make the code more readable, and adding spaces before and after the + changes to the following:Make the change repeatablef+Executes the find character command on the current line, the S command
Vim as a custom-made editor, it is really very powerful, here I say in programming, using VIM and makefile some of the skills, just personal programming habits;When you finish editing the source code, want to compile links and other work, you can
Find and Replace by HandIn the text above, we are going to change the content to Word copyMaybe we can use the following command.:%s/content/copy/gThe above command changes all the content words in the text to copy, but we do not want the content in
The recent use of VIM's regular replacement feature is very powerfulA file:1,2,34,5,61,2,34,5,61,2,34,5,61,2,34,5,61,2,34,5,6Now you need to delete the contents before the comma, then in the vim-typed command::%s/.*,//gThe resulting results are: 3
Not much else to say, is to let Sublime,vim into one!#Download Sublime FirstHttp://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2%20x64%20Setup.exeThis is 2.0.2, to other versions on their own Baidu official website!#Download the attachment
Fast Jump (cmd model) within Vim's line^: The cursor jumps quickly to the first character of the bank header .$: The cursor quickly jumps to the last character at the end of the bank.NW: The cursor quickly jumps to the header of n fields after
Vi-vim Editor: Full screen editor, modal editorVim mode:Edit mode (Command mode) Input mode Last-line mode (bottom-row mode)Mode conversion: Edit mode--Input mode: I: Enter in front of the character where the
I often use a manual folding method, which is: Set Foldmethod=manualThe commonly used folding commands for VIM are:ZF: Collapse the selected rowZo: Open collapseZR: Open All foldsZM: Close all foldsZD: Delete collapsedMy personal most commonly used
x Delete the characters under the current cursorDW Deletes the remainder of the word after the cursor.d$ the remaining portion of the line after the cursor is deleted.DD deletes the current line. the C function is the
Vim is a reinforced version of VI, it is recommended to use VIM.Vim has three different modes:Command mode (normal mode)After Vim starts, it enters command mode by default, and any mode can be returned to command mode by ESC. Command mode can be
Move word-wiseFaster left and right shortcuts in Vim in Word are:The visual display is as followsThese shortcuts can be used in conjunction with other commands to quickly select a word.Taken together, the ea commands can is read as "Appendat the end
Delete Lines containing a PatternCombining the :global and :delete commands allows us to cut down the size of a file rapidly. We can either keep or discard all lines that match a {pattern} .:globalthe Combine and: Delete command allows you to
Use of the VIM editorVI Visual Interface visual Interface VI EditorEnhanced version of the VIM VI Improved VI editorVIM Full screen editor, modal editorVim modeEdit mode (Command mode)Input modeLast-line modeVim Open file default to edit mode, they
Swap or more WordsThe following fileSuppose that we want to swaps the order of the words "dog" and "man."Suppose we are going to swap the two words of dog and man in the text, what should we do? We're trying to use the following command:%s/dog/man/g:
Collect TODO Items in a RegisterCombining The:global And:yank commands allows us to collect all lines this match a {pattern} in a register.This excerpt of code contains a couple of comments that leads with "TODO":The combination :global and the
Description: The contents of this article as a record of their own environment, the content is basically found from the Internet, so the original author looked not too mind. In addition, I am a Mac computer, please refer to the attention of the
"=======================basic___configuration_start===================="Modifying the default directory"": cd D:\dream\programmingSetts=4 "the length of the TAB keySyntax on"Syntax HighlightingSetNocompatible"remove nasty about
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.