vim Command-line ranges Line shortcuts


  • . represents the current line but it can also be omitted entirely.
  • $ represents the last line.
  • % represents the whole buffer, it is a shortcut for 1,$.

The two commands below execute :command on every file from the current line to the last line:


The command below executes :command on the whole buffer: