Take the 2-minute tour ×
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.

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:

:11,22!fmt

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

For one line I could write :

:22!fmt

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
add comment

1 Answer

up vote 6 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

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.