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 ...
-
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/ =-
-
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
-
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
-
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.
-
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.
Similar Threads
-
By Application Development in forum DOTNET
Replies: 0
Last Post: 11-16-2007, 12:22 PM
-
By Application Development in forum Java
Replies: 1
Last Post: 10-10-2007, 11:30 AM
-
By Application Development in forum DOTNET
Replies: 5
Last Post: 09-04-2007, 11:57 AM
-
By Application Development in forum Javascript
Replies: 2
Last Post: 08-01-2007, 06:02 PM