I have the following in a .vimrc file:
vmap ; :Blockwise<SPACE>
I'm not sure what the Blockwise
key word does.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityI have the following in a .vimrc file:
vmap ; :Blockwise<SPACE>
I'm not sure what the Blockwise
key word does.
It's an Ex command, and since its first character is written in uppercase, it's probably a custom command.
To see what it does, and where it was defined, you can use this command:
:verbose command Blockwise
… or shorter:
:verb com Blockwise
By default, an Ex command operates on whole lines.
So, for example, suppose you wanted to perform a substitution inside a column in a paragraph. You could visually select it, then type :s/pattern/replacement/g
. You could think that the substitution command would replace the occurrences of pattern
with replacement
only inside the block, but since Ex commands operates on whole lines, :s
would replace pattern
anywhere in the paragraph, not just inside the column you selected.
As a workaround, inside the pattern, you could use the atom \%V
(see :h /\%V
), but it may not be always as simple for other commands (other than :s
).
With your mapping, if you hit ;
in visual mode, Vim will write on the command line :'<,'>Blockwise
.
So, it's just a guess, but your :Blockwise
command probably expects as an argument another command, and limits the effect of the latter on a visual blockwise selection. It may be a mechanism to enable all or most of Vim Ex commands to operate on blockwise selection, and not just whole lines.
With it, you could probably do something like:
:'<,'>Blockwise s/pattern/replacement/g
… to replace pattern
with replacement
, only inside the visual block.
When you find the name of a command which you don't know, you can try to look for it inside the help, with the :helpgrep
or :lhelpgrep
command. The latter can be shortened into :lh
. Currently, if I type:
:lh :Blockwise
I don't have any results, so with this you would know it's not a default Vim command. However, if it has been installed with a plugin which has some documentation, then it's possible that the previous command returns some results.
You probably want to replace :vmap
, with :xnoremap
. In front of a :map
command, v
doesn't mean visual mode
, it means visual mode
+select mode
. x
stands for visual mode only. So, if you use :vmap
, you will bind a printable character (;
) in select mode
. And the help says that it could be confusing to a user (:h mapmode-x
):
NOTE: Mapping a printable character in Select mode may confuse the user.
You could change your mapping like this:
xnoremap ; :Blockwise<Space>
:verb vmap ;
to see where it is defined. Must be a plugin, so read its description.a
.vimrc file not specificallyhis
.vimrc