Often times when I paste into vim I get cascading indents that are quite frustrating to fix. The result will look something like this
This is line one
This is line two
This is line three
This is line four
I'd like to know if there is a way that I could tell vim to align lines two through four with line one. If line one text is starting at cursor position 6 is there a way to say "make the next ten lines also start at position 6?"
To correct this cascading indentation, you can re-indent a block using =
. Select a visual block and type =
or supply a motion: =4j
to re-indent the next 4 lines.
You might avoid the cascading indentations by setting paste
before pasting: :set paste
. After the paste :set nopaste
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With