: s/vivian/sky/replaces current line first Vivian for Sky
: S/vivian/sky/g replaces current line all Vivian for Sky
: N, $s/vivian/sky/replaces the first n line to the top Vivian for each line in the last line of Sky
: 2, $s/vivian/sky/g replaces
1. Start-R Read-only mode, but if you have permission to do so, you can force the save.-C (command) after loading executes the command, such as "Vim-c/most myfirst" Open the file, and then search directly backwards most.More can refer to-h
2.
Using Find-and-replace methods
In Linux, the starting mark for each line of text is ^, the ending sign is $, so use vim to search for ^ and replace with ^ #即可.
: 10,20s/^/#/g
Indicates that 10-20 rows are added to the annotation, and the same
vim most general editor commands command very much, only need to master the following some of the commonly used, basically fully enough.The most concentrated of the essence.Vim Insert mode Command mode edit mode : Set number sets line numbers: Set
Vim is set to automatically add spaces to the left and right sides of the operation symbols such as =+-. The original VIM does not have this function, write code such as Z=x+y, not beautiful, many compilers (such as VS) can automatically add space
"2017-02-04"First put a few better information, look at this information is good:1.Vim Primer Foundation Http://www.jianshu.com/p/bcbe916f97e12.vim Configuration http://blog.csdn.net/g_brightboy/article/details/142291393. The concise Vim practice
These are the most commonly used commands of VIM! Remember the "Mr.robot" that will improve efficiency----------------------------------------------------The common commands that VIM requires:D G Delete allI currently edito New Line EditGG
Enter the tutorial in terminal vimtutor: go back to normal mode or undo a command that you don't want to enter/partially completeH, J, K, l keys move the cursor separately ←↓↑→Press the key after entering normal mode: q! Exit and discard any
Just installed Vim, perhaps the interface is not very friendly, which requires us to change the vim configuration file, according to our needs to modify it.Under command line, enter the command:sudo vim/etc/vim/vimrcYou must add sudo, otherwise you
Referenced by: http://blog.csdn.net/hzhsan/article/details/44228241Open Vim ~/.VIMRC in terminalThen add:Set Hlsearch #设置高亮显示搜索结果nnoremap \h :nohlsearch #定义一个映射For example, Vim xxx.pyThen/with #搜索with这个字符In the result, with will be highlighted,
In this section we take a look at the delete, delete command is relatively simple, but to make the deletion more efficientYou need to match the various move commands we've talked about in the first section.Character deletionx Delete the
1. Mode switchThree modes: Command mode, input mode, bottom line modeSwitch between command mode and input mode: I ESCSwitch between command mode and bottom-line mode: SHIFT +: ESC2. InsertI: Insert on the left of the current characterI: Inserting
Vim mode:Edit modeInput modeLast-line modeMode conversionEdit-InputI: Switch to input mode before the current cursor characterA: After the current cursor is in the same character, switch to input modeo: Insert a row below the current cursor line,
You can use the: s command to replace a string in Vi/vim. The command has a number of different details of how to use the method, you can implement complex functions, record several here, convenient later query.: s/vivian/sky/replaces the current
Normal mode (press ESC or ctrl+[) the lower-left corner displays the file name or is emptyInsert mode (press the I key to enter) the lower left corner shows--insert--Visual mode (Press v key to enter) the lower left corner shows--visual--I inserted
When writing the files configuration of the NPM. Pakege.json file, if you have a file that you do not want to include, create a. npmignore file to exclude, but the Windows system does not allow you to create a file named after the point?This is the
: s/str1/str2/Replacement Current Line the first str1 is str2: S/str1/str2/g replaces all str1 in the current line as str2: M,ns/str1/str2/replaces the first str1 of each row in the beginning of the nth row to the last row str2: M,ns/str1/str2/g
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.Directory (?) [+]Getting Started with vim tutorials
Vim Practical Technology
Learning the VI and Vim Editors
A Byte of Vim
These two days and vim more retwist, summed up in fact is very meaningless toss, wasted a lot of precious time!The thing is this, inadvertently found vim in the Win10 console window without parameters to display the "Ugandan Children" interface (in
Solve vim garbled characters in centos
My system is centos 6.8
UTF-8 is selected for xhsf-connection.
When I use vim for editing, Chinese characters always show garbled characters. Although cat is normal, it is inconvenient for editing.
The
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.