Text substitution in vim: 1. Replace the contents of the current line: :s/from/to/ (S is substitude) :s/from/to/ : replaces the first from in the current line with a to. If the current row contains more than one
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
Trace Your Selection with Precision Text ObjectsFor brackets, quotation marks, and so on, such as the labels in Html,xml, are paired, Vim can understand this structure, and select the text of their restricted area.For the following JS codeExecute
.VIMRC is configured as follows "path specifies the paths to find, details help path" includeexpr is trying to replace the path name. for/, details of the includeexpr "Suffixesadd for the attempt path suffix, details help Suffixesaddset
Find by CharacterThe command to quickly navigate to a character in Vim is fThe The FX command does nothing. Vim searches forward for a occurrence of the "X" character, but no matches is found, so the cursor doesn ' t move. The FO command finds an
Recently bored, suddenly want to play with Tianchi data mining, found that the data is big, want to switch to MySQL database, phpMyAdmin import when importing wrong! Data file Big! So, ready to intercept a small piece to another file test first,
Work for three years, has been in the semi-command line, the state of the semi-IDE, slowly summed up part, easy to use later."Basic" 1. tabOpen a file in a new tab:tabedit filenameVim has added multi-tab switching functionality from VIM7, which is
Command historyCommands with: and/begin with a history, you can first type: or/Then press the up and down arrows to select a history command.Start vimEnter the following command in the Command line windowVim starts vim directlyVim filename opens vim
One, vim repeat command 1. Repeat the last commandIn normal mode . (decimal point) means the last command operation is repeatedCopy test files to a local directory$ cp /etc/protocols .Open a file for editing$ vim protocolsNormal mode input x ,
First, open the fileVim filename #打开文件, the cursor is placed on the first lineVim/pattern filename #打开文件, line with cursor pattern matchingVim–r filename #恢复上次意外中止的编辑文件Second, the general mode of cursor positioningCtrl+f #屏幕向下移动一页Ctrl+b
Text substitution in vim: 1. Replace the contents of the current line: :s/from/to/ (S is substitude) :s/from/to/ : replaces the first from in the current line with a to. If the current row contains more than one
This is a plugin for quickly and efficiently commenting codeWith this plugin, you can annotate files of multiple file types in different ways and quickly. This is a powerful tool for improving efficiency and pleasure for the students who use vim to
Learning Linux using Vim to write C/D + + code is necessary, VIM plus some necessary plug-ins can make development more efficient, but in the online search of the data are copied each other and not very detailed, decided to summarize their own
Common vi/vim commands and vivim commands
Vi/vim commands are complex and powerful. Here we will introduce some commonly used commands that can meet general needs.
Move the cursor: -Shift left: h-Move Down: j-Move up: k-Shift right: l-Flip: ctrl
Use the shortcut key of linux vim to move the cursor.
Move cursor
H or left arrow: The cursor moves a character to the left, and the numbers and letters are used together. 5 h indicates that 5 characters are moved to the left, and so on.
J or
Linux-vim, the most common operation, linuxvim
1. Open a file
Vim + #: open the file and locate it in line #
Vim +: open the file and navigate to the last line.
Vim +/PATTERN: open the file and locate the first line of the line matched by
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