How to map i
to start editing on visual block mode?
I want the same behavior for <shift>-i
and i
.
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 communityHow to map i
to start editing on visual block mode?
I want the same behavior for <shift>-i
and i
.
You can use :h map-expression
to determine which version of visual mode you are in, and change the behaviour accordingly. Visual mode mapping
vnoremap <expr> i mode()=~'\cv' ? 'i' : 'I'
will make i act as i
in visual and linewise-visual modes, and as I
otherwise, i.e. in blockwise visual mode.