xralf
xralf

Reputation: 3772

Correct indentation

I had a HTML file with correct indentation. I deleted the <html> tags and <head>...</head>. My file is now indented too in the right and I'd like to shift everything to the left (about four spaces).

I tried the gg=G command without success

I tried it in visual mode by pressing V, selecting everyline, pressing I, deleting four spaces and pressing ESC - without success.

Is there some trick that can shift the indentation to the left?

thank you

Upvotes: 1

Views: 538

Answers (3)

Herbert Sitz
Herbert Sitz

Reputation: 22266

I'm not sure I follow. Is it still an html file? If not, then just give the filename a different extension (e.g., '.txt') and reopen it. Then you can adjust indents however you want without the automatic html indenting being a problem.

Upvotes: 0

Mud
Mud

Reputation: 29021

Select the lines, then press:

<

For more info:

:help shift-left-right

You could also use CTRL-V to enter block mode select, then delete the columns you don't want. You can also use CTRL-V to select a column then use < or > to indent/unindent only text to the right of that column (that can be very handy).

Upvotes: 2

Martin Ždila
Martin Ždila

Reputation: 3219

Try <G in the command mode.

Upvotes: 2

Related Questions