mirror of
https://github.com/Hizenberg469/Vim-tutorials.git
synced 2026-04-19 22:02:24 +03:00
Replace command update
This commit is contained in:
60
vim-commands
60
vim-commands
@@ -367,3 +367,63 @@ Line mode:
|
||||
|
||||
It perform operation and behave in similar manner as done by t +
|
||||
<character> command. But, the searching is done in reverse order.
|
||||
|
||||
**Note**
|
||||
|
||||
All these are motion-commands. That means, we can use it with Editing
|
||||
commands like d (delete), c (changing), y (yanking), etc.
|
||||
|
||||
|
||||
@ Command :- /<string>
|
||||
|
||||
What does it do?
|
||||
|
||||
It searches for the <string>.
|
||||
|
||||
Using "n" command will search for next <string> occurance in current
|
||||
opened file.
|
||||
|
||||
Using "N" command does the same thing. But, in opposite direction.
|
||||
|
||||
**Note**
|
||||
|
||||
For "/" command for searching the incsearch option should be set.
|
||||
|
||||
If it is not, we can use following line command:
|
||||
|
||||
:set is
|
||||
|
||||
To check if the configuration is set use command:
|
||||
|
||||
:set is?
|
||||
|
||||
For highlighting the searches, check for:
|
||||
|
||||
Check :set hls?
|
||||
|
||||
Output: nohlsearch
|
||||
|
||||
Do: :set hls
|
||||
|
||||
Note that hlsearch is enabled will highlight the <string>s' until
|
||||
new search is done which in turn highlight the new <string>.
|
||||
To turn off the highlight, use:
|
||||
|
||||
:nohls.
|
||||
|
||||
It will turn-off the highlights not disable it permanently.
|
||||
|
||||
|
||||
%% Trick %%
|
||||
|
||||
> Using "/" command to find a string or string containing the pattern specified
|
||||
and pressing enter will take to the first such matching string.
|
||||
|
||||
> If we now use "c + w" command the cursor which is present at the first letter
|
||||
of the word will delete that word and we type certain word.
|
||||
|
||||
> After getting out of the insert mode, pressing "n" command will move the cursor
|
||||
the cursor to the next string and pressing the command "." will repeat the changes
|
||||
that we did for first string i.e. repeat the process that we performed above.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user