Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just came across this example in Learning the vi and Vim Editors:

.Rh 0 "Get status of named file" "STAT"

The command to move DESCRIPTION above the SYNTAX paragraph is given by


The explanation given is: First, ex finds and marks each line that matches the first pattern. Second, for each marked line, it sets . (dot, the current line) to that line and executes the command.

But why do we need the dot after /SYNTAX/? Is it a special syntax for the g command?

share|improve this question
up vote 1 down vote accepted

:g takes a command after its pattern. :m is the command, and it takes a range before it. . is the beginning of that range.

share|improve this answer
I see, so :g will automatically set . to the line that matches the pattern? – Yang Jun 29 '13 at 5:22
The pattern will become the current line being operated on. – Ignacio Vazquez-Abrams Jun 29 '13 at 5:22
Got it, thanks! – Yang Jun 29 '13 at 5:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.