Search code examples
vimviemu

Repeat a line command?


I'm new to the more advanced aspects of vi/vim/viemu

I commonly need to select a bit of text and indent/undent, among other things. Right now I have two ways to do this:

  • select the text and use <<
  • use a multi-line command such as :198,205<<

Now, sometimes I need to do this multiple times. When using the dot command though(.) it will never repeat my last command unless I was previously in insert mode. Instead, it will just delete the current line.

Is there a quick and easy way of doing this?


Solution

  • Use V to visually select the lines and then press the keys 5 then > to indent the lines 5 tabs to the right (or just < to indent once to the left).