VIM: how to control wrap width?? Please help - Editors

This is a discussion on VIM: how to control wrap width?? Please help - Editors ; i have a file that is 1000 characters long with no carriage returns. I want it to wrap evey 10 characters. Is there any way to make vim wrap at 10 characters without setting my window to be 10 characters ...

+ Reply to Thread
Results 1 to 5 of 5

VIM: how to control wrap width?? Please help

  1. Default VIM: how to control wrap width?? Please help

    i have a file that is 1000 characters long with no carriage returns. I want it to wrap evey 10 characters. Is there any way to make vim wrap at 10 characters without setting my window to be 10 characters wide?

    Right now my window is 80 columns wide, so if i :set wrap it wraps at every 80 chars.

    This is just an example, my real data file is like an 80,000 charcter string with no carriage return, and i want it to wrap at every 762 chars so i can read it.

    Thanks in advance.
    Jman


    --------------= Posted using GrabIt =----------------
    ------= Binary Usenet downloading made easy =---------
    -= Get GrabIt for free from http://www.shemes.com/ =-


  2. Default Re: VIM: how to control wrap width?? Please help

    daButcher wrote:

    > i have a file that is 1000 characters long with no carriage returns. I
    > want it to wrap evey 10 characters. Is there any way to make vim wrap at
    > 10 characters without setting my window to be 10 characters wide?


    If you're talking about inserting newlines into the text, you can use
    this:

    s/.\{10}/&^M/g

    (Where ^M means to type CTRL-V and then Enter.) This has been tested only
    mildly; as always with Vim, this is but one of the myriad ways to do it.

    HTH,
    --
    Benjamin D. Esham
    bdesham@gmail.com | AIM: bdesham128 | Jabber: same as e-mail
    Esperanto, the international language ☆ http://www.lernu.net

  3. Default Re: VIM: how to control wrap width?? Please help

    Thanks for the help. This will work, but i was wondering if there was a way
    to do it without modifying the file. I've searched all day and can't find
    anything.
    Also \r working instead of the ^M.

    Thanks again.

    Jman





  4. Default Re: VIM: how to control wrap width?? Please help

    On 2007-03-01, daButcher <j@j.com> wrote:
    > i have a file that is 1000 characters long with no carriage returns.
    > I want it to wrap evey 10 characters. Is there any way to make vim
    > wrap at 10 characters without setting my window to be 10 characters
    > wide?
    >
    > Right now my window is 80 columns wide, so if i :set wrap it wraps
    > at every 80 chars.
    >
    > This is just an example, my real data file is like an 80,000
    > charcter string with no carriage return, and i want it to wrap at
    > every 762 chars so i can read it.


    You could hard-wrap it with :set tw=762 followed by gggqG, read it,
    and then undo.

  5. Default Re: VIM: how to control wrap width?? Please help

    Thanks Ben, Thats closer to what i'm looking for, but it only wraps the
    text if there is a space in the line.

    I guess there's no way to wrap text (without inserting a new line) at like
    column 100 or 70 if your window is exactly 80 columns wide.

    John

    "Ben C" <spamspam@spam.eggs> wrote in message
    news:slrneud3q7.nmg.spamspam@bowser.marioworld...
    > On 2007-03-01, daButcher <j@j.com> wrote:
    >> i have a file that is 1000 characters long with no carriage returns.
    >> I want it to wrap evey 10 characters. Is there any way to make vim
    >> wrap at 10 characters without setting my window to be 10 characters
    >> wide?
    >>
    >> Right now my window is 80 columns wide, so if i :set wrap it wraps
    >> at every 80 chars.
    >>
    >> This is just an example, my real data file is like an 80,000
    >> charcter string with no carriage return, and i want it to wrap at
    >> every 762 chars so i can read it.

    >
    > You could hard-wrap it with :set tw=762 followed by gggqG, read it,
    > and then undo.




+ Reply to Thread

Similar Threads

  1. dropdownlist expand display width not control width
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 11-16-2007, 12:22 PM
  2. Text Width Checker, useful to avoid line wrap
    By Application Development in forum Java
    Replies: 1
    Last Post: 10-10-2007, 11:30 AM
  3. Cannot control the width of the label control
    By Application Development in forum DOTNET
    Replies: 5
    Last Post: 09-04-2007, 11:57 AM
  4. Using % on a table width, is it possible to get the width in pixel size?
    By Application Development in forum Javascript
    Replies: 2
    Last Post: 08-01-2007, 06:02 PM