showkey
showkey

Reputation: 358

how to move the lines left at one character width in vim?

When i edit python file in gim

:3,10 <

That command can move lines between 3th and 10th to the left at 4 characters width. How to move the lines from 3 till 10 line left at one character width in vim?

Upvotes: 1

Views: 184

Answers (2)

Ingo Karkat
Ingo Karkat

Reputation: 172590

The anwolib plugin provides a neat :With ... Do command. With it, you can also automate (via a custom command or mapping) this easily:

:With sw=1 Do 3,10 <

Upvotes: 1

Zach
Zach

Reputation: 4792

Use the following commands

:echo(&shiftwidth)
Make note of result in brain
:set shiftwidth=1
:3,10 <
:set shiftwidth=(note made in brain)

Alternatively

:3,10 s/^ //

Upvotes: 2

Related Questions