Multiline file appearing in one line under Vim

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiline file appearing in one line under Vim

Eddine-2
Hi all,


I have a file which behaves differently whether edited with win32
Notepad and gVim.
When opened in notepad I got several lines, which is the most
convenient "layout" for me, but when opened in gVim I got the file in
only one line.

I tried to set "ff" to "dos" but it does not have any effect.

Does any one have a clue ?
How can I do to have the file edited in several lines ?
What have I missed ?

Thank you.

Eddine.
Reply | Threaded
Open this post in threaded view
|

Re: Multiline file appearing in one line under Vim

iler.ml
On 5/17/06, Baha-Eddine MOKADEM <[hidden email]> wrote:

> Hi all,
>
>
> I have a file which behaves differently whether edited with win32
> Notepad and gVim.
> When opened in notepad I got several lines, which is the most
> convenient "layout" for me, but when opened in gVim I got the file in
> only one line.
>
> I tried to set "ff" to "dos" but it does not have any effect.
>
> Does any one have a clue ?
> How can I do to have the file edited in several lines ?
> What have I missed ?

Can you attach the file ?

Yakov
Reply | Threaded
Open this post in threaded view
|

Re: Multiline file appearing in one line under Vim

Matthew Winn
In reply to this post by Eddine-2
On Wed, May 17, 2006 at 03:19:39PM +0200, Baha-Eddine MOKADEM wrote:
> I have a file which behaves differently whether edited with win32
> Notepad and gVim.
> When opened in notepad I got several lines, which is the most
> convenient "layout" for me, but when opened in gVim I got the file in
> only one line.

Is it really several lines in Notepad, or is it one long line that has
wrapped?  If the latter then the following will help:

:set wrap linebreak
:map <Up> gk
:map <Down> gj

--
Matthew Winn ([hidden email])
Reply | Threaded
Open this post in threaded view
|

Re: Multiline file appearing in one line under Vim

Jonathon Merz
In reply to this post by Eddine-2
On 5/17/06, Baha-Eddine MOKADEM <[hidden email]> wrote:

> Hi all,
>
>
> I have a file which behaves differently whether edited with win32
> Notepad and gVim.
> When opened in notepad I got several lines, which is the most
> convenient "layout" for me, but when opened in gVim I got the file in
> only one line.
>
> I tried to set "ff" to "dos" but it does not have any effect.
>
> Does any one have a clue ?
> How can I do to have the file edited in several lines ?
> What have I missed ?
>
> Thank you.
>
> Eddine.

By any chance, is notepad wrapping it?  Check in notepad if "Word
Wrap" is checked under the Format menu.  If so, you may actually have
a single line file that is being wrapped automatically in notepad.
For similar wrapping in Vim:
     :set wrap

I say similar since there are a number of options that can affect
exactly how Vim wraps.  See
     :help wrap
for a quick howto and a list of some of the options affecting wrapping in vim.

Jonathon
Reply | Threaded
Open this post in threaded view
|

Multiline file appearing in one line under Vim

Eddine-2
I'm attaching the file so you can have a better idea.
And it's not a problem of wrapped unwrapped option on Vim.
The file is indeed converted from EBCDIC format to ASCII (through dd
command) it could explain but I won't able to say why.

Eddine.

single_line_file.txt (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Multiline file appearing in one line under Vim

Georg Dahn
In reply to this post by Eddine-2
Hi!

My guess is: notepad breaks at column 1024. In notepad the first two
lines of your file have exact 1024 characters. This could be a
notepad limitation.

Best wishes,
Georg



Baha-Eddine MOKADEM wrote:

> Hi all,
>
>
> I have a file which behaves differently whether edited with win32
> Notepad and gVim.
> When opened in notepad I got several lines, which is the most
> convenient "layout" for me, but when opened in gVim I got the file in
> only one line.
>
> I tried to set "ff" to "dos" but it does not have any effect.
>
> Does any one have a clue ?
> How can I do to have the file edited in several lines ?
> What have I missed ?
>
> Thank you.
>
> Eddine.
>
Send instant messages to your online friends http://uk.messenger.yahoo.com 
Reply | Threaded
Open this post in threaded view
|

Re: Multiline file appearing in one line under Vim

Eddine-2
2006/5/17, Georg Dahn <[hidden email]>:
> Hi!
>
> My guess is: notepad breaks at column 1024. In notepad the first two
> lines of your file have exact 1024 characters. This could be a
> notepad limitation.
>
> Best wishes,
> Georg


Is there a way to make profit of this kind of limitation. Or is there
a way to cut the single line so I can have n lines of the same L
length ?
Reply | Threaded
Open this post in threaded view
|

Re: Multiline file appearing in one line under Vim

Gerald Lai-2
On Wed, 17 May 2006, Baha-Eddine MOKADEM wrote:

> 2006/5/17, Georg Dahn <[hidden email]>:
>> Hi!
>>
>> My guess is: notepad breaks at column 1024. In notepad the first two
>> lines of your file have exact 1024 characters. This could be a
>> notepad limitation.
>>
>> Best wishes,
>> Georg
>
>
> Is there a way to make profit of this kind of limitation. Or is there
> a way to cut the single line so I can have n lines of the same L
> length ?

Perform:

   :g/\%1025c/wh getline(".")=~@/|s//\r/|endw

This will slice the single line into multiple lines of 1024-length.

HTH.
--
Gerald
Reply | Threaded
Open this post in threaded view
|

RE: Multiline file appearing in one line under Vim

Suresh Govindachar`

On Wed, 17 May 2006, Baha-Eddine MOKADEM wrote:
> 2006/5/17, Georg Dahn <[hidden email]>:
>>
>> My guess is: notepad breaks at column 1024. In notepad the first two
>> lines of your file have exact 1024 characters. This could be a
>> notepad limitation.
>
> Is there a way to make profit of this kind of limitation.

The limitation is in Notepad, not in Vim.

> Or is there a way to cut the single line so I can have n
> lines of the same L length ?

Yes -- see :help textwidth and :help gq

For example, for lines of length 60, do :set tw=60.
Then put cursor on the line line and type gqq.

--Suresh