vim: quick column insert
19,880
I use the following mappings that allow to prepend / append spaces (also multiple with a [count]
before the mapping):
:vnoremap <C-Space> I<Space><Esc>gv
:vnoremap <C-S-Space> A<Space><Esc>gv
Custom mappings such as these are the key to efficient editing, and very powerful in Vim. You'll find all the details in the :help
.
Author by
alexzzp
Updated on July 20, 2022Comments
-
alexzzp almost 2 years
I have been using Vim for my text editor in place the notepad++. I want to know is there a way to perform "quick column insert" in vim.
As I know, we are able to perform column insert in vim in following steps:
- move to the position
- enter column visual mode CTRL+v
- select the column j or k
- enter into column insert mode shift+i
- insert the text
- type Esc
then the column insertion is performed
is there a way to delete the step 4 and perform column insertion directly?
-
romainl over 11 yearsYou want the kind of real-time feedback you get in ST2, don't you?
-
Tom Whittock over 11 yearsSo... Skip step 4... What happens if the first character you want to type is j or k?
-
NeilG almost 4 yearsJust found out about column insertion mode! Simply
shift+i
! Fandabidozi. Of course you need a step to establish a new mode, because without it you're still in the original mode. And the modes are the most powerful feature of Vim. No other editor on the planet does it like Vim.