Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For Vim users: I'm looking for the equivalence of tw=80, gq

I have two paragraphs of a certain width, which I'd like to reformat to fit in the width of 80 characters. What is the easiest way to do that, while keeping the paragraphs (empty line between) separate?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

80 characters should be the default width, otherwise:

C-x f 80 RET

Then select your paragraphs and press:

M-q

For the justified version use:

M-1 M-q

Where M is the meta key: Alt or Esc.

share|improve this answer
    
80 was just an example. In any case, works perfectly, thanks cYrus! –  ldigas Jan 4 '12 at 11:35
    
Btw, does emacs have a command to restore the last selection again? (so I don't have to go any select the region manually over and over)? –  ldigas Jan 4 '12 at 11:36
2  
I don't know, but if it concerns paragraph reformatting consider the following: 1) M-q will be applied to the current paragraph if nothing else is selected; 2) you can M-x auto-fill-mode to automatically reformat text as you write it. Hope this helps. –  cYrus Jan 4 '12 at 11:44
    
It does somewhat, yup :) –  ldigas Jan 4 '12 at 11:58
    
@Idigas: If you didn't move you can use C-x C-x to exchange-point-and-mark and thus reselect the last region. If you've moved, the last region will be selected extended to your current position. –  Daimrod Jan 4 '12 at 16:45
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.