Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

When I want to format part of text with fmt in vim I usually select parts of interesting lines in Visual Mode, with: Ctrl+V Arrows, and than type !+f+m+t.

When there are couple of lines they are other ways of doing this:


When text to be formatted is places between 11 and 22 line.

For one line I could write :


But this is not comfortable to type new number, each time I change line.

Is there a way of doing this : :22!fmt without 22 but some mark, variable, that means "current line" ?

share|improve this question
up vote 6 down vote accepted

. means 'current line'. .!fmt does what you want

share|improve this answer

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.