On 05/01/09 03:40, Aman Jain wrote:
> I often come across text files that contain long paragraphs, and vim's
> numbering(:se nu) shows only one line for a paragraph until unless a
> newline is encountered.
> It is a pain to read that way.
> Is there a way to render a paragraph in the form of numbered lines
> whereby each line contains a fixed number of characters?

If you want /numbered/ lines where numbers correspond to screen lines 
but maybe to only part of a "real" file line: no.

Reformat the file to insert line breaks at no more than a fixed length: 
yes. Let's say you want lines of 100 characters (or maybe a little less 
to avoid breaking in the middle of a word), then:

        :setlocal tw=100
        gggqG

will reformat the whole file to the given width, keeping paragraph 
breaks (preexisting empty lines).

Or instead of gggqG, use <Visual>gq to format only the highlighted lines 
(i.e. gq after using shift-v + cursor moves to set up a linewise visual 
area).


Best regards,
Tony.
-- 
DENNIS:  Listen -- strange women lying in ponds distributing swords is no
          basis for a system of government.  Supreme executive power derives
          from a mandate from the masses, not from some farcical aquatic
          ceremony.
                                   The Quest for the Holy Grail (Monty 
Python)

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to