Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In VIM how can I configure ctrl-v to enter visual blockmode while in insert mode?

Tags:

vim

My Google skills failed me. I thought this would be an old, well worn question.

In VIM input mode, how do I get <c-v> to be recognized as if I were in Normal mode, i.e. enter visual blockwise mode?

I tried a noremap! <C-v <ESC>:visual block, but that obviously isn't quite the right set of magic words.

NOTE: changed "edit mode" to "insert mode" as suggested by @Explosion's comment.

like image 986
Wes Miller Avatar asked Jan 29 '14 20:01

Wes Miller


People also ask

How do I enable visual blocks in Vim?

To enable the Visual block mode in Vim, you have to try out the “Ctrl+V” command within the normal mode.

What is the shortcut to enter insert mode in Vim?

You can enter insert mode by pressing the i key. Keep in mind that to save your document, you'll need to go back to command mode since only text input is allowed in this mode.


1 Answers

What you want is inoremap, which maps in insert mode. You can just use <C-v> since it is not remapped.

inoremap <C-v> <Esc><C-v>
like image 97
Explosion Pills Avatar answered Oct 19 '22 04:10

Explosion Pills