Why#
This blog will evolve to including more valuable content.
Using nvim
tag to filter more content about nvim and others.
001 Using command mode in visual block.#
After you select a visual block in vim, you can execute operation on the block by typing :normal ops
.
ops
means the operations you intend to do.
For instance, let’s assume that you have a text as shown below, and you have already select them in virtual mode.
After typing :normal Atest
that mean appends “test” to every line at the end.
You will see:
002 Mapping <C-d>
and <C-u>
to <C-d>zz
and <C-u>zz
.#
<C-d>
is key combinations of Control
and d
.
In normal mode, <C-d>
means half page down and <C-u>
means half page up.
zz
is key combinations of double z
, which help center cursor to middle position of current buffer.
The new mapping is combinations of these two operations.
Even though page is moved to up or down, the focus will always be center.
003 Repeat and Reverse Operation 1#
004 daw
or daW
delete one word and cW
or cw
delete one word then#
005 <C-h>
and <C-w>
to delete words in insert mode.#
For example, assuming current buffer contains this is a test.
<C-h>
will delete one character and <C-w>
will delete one word.
006 <C-o>
enter Insert normal mode#
Insert normal Mode means that the buffer will leave at insert mode after using Norm mode.
For example, we assume current buffer is this is a test,
007 gv
select recent visual block#
008 Vr
+ character replace one line with same character#
009 use *
to search for each occurrence#
You can use *
to search the word at which the current cursor locate.