vim: quick column insert

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

Share:
19,880
alexzzp
Author by

alexzzp

Updated on July 20, 2022

Comments

  • alexzzp
    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:

    1. move to the position
    2. enter column visual mode CTRL+v
    3. select the column j or k
    4. enter into column insert mode shift+i
    5. insert the text
    6. type Esc

    then the column insertion is performed

    is there a way to delete the step 4 and perform column insertion directly?

    • romainl
      romainl over 11 years
      You want the kind of real-time feedback you get in ST2, don't you?
    • Tom Whittock
      Tom Whittock over 11 years
      So... Skip step 4... What happens if the first character you want to type is j or k?
    • NeilG
      NeilG almost 4 years
      Just 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.