How 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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.