Let's say I have a text file called index.html.slim
that looks like this:
- if post.published?
section.post
h1 = post.title
p = post.description
a = link_to 'Read more', post
What I'd like to do is indent the last 3 lines so that the file looks like this:
- if post.published?
section.post
h1 = post.title
p = post.description
a = link_to 'Read more', post
What's the most efficient way to do this in Vim?
Right now to do this I would go to line 3 with 3 return
, i
to enter insert mode, spacebar
twice to indent two characters and then esc
to exit insert mode. To do this on line 4 and 5 I would move down with j
and press .
followed and then wq
to save.
That's a total of 10 keystrokes. I'm sure there's a better way to accomplish this; however, I'm not sure what the best method is.