Tuesday, September 30, 2014

Re: How to edit remove Linux files on gVim on Windows without 'end of line' character problem?

On Tuesday, September 30, 2014 7:50:19 AM UTC-5, Igor Forca wrote:
> Hi,
> using gVim on Windows 7. I would like to open remote file from Linux on my Windows box and edit it in gVim for Windows.
>
> I did the following:
> 1. From Putty program I have renamed PSCP.exe file to scp.exe and copied it to C:\Windows\System32\ directory.
>
> 2. Started gVim and typed in a command:
> :e scp://username@server//path/to/file
>
> 3. File opens successfully. But like I see there is "end of line" character problem.
>
> 4. On Linux box I opened vim and typed in a text:
> a
> a
> So two letters a with new line.
>
> 5. I executed :%!xxd to get the hexadecimal display of characters and I get:
> 61 0A 61
> So 61 is letter a, and 0A is a "new line" character.
>
> 6. After executing "e scp..." command on gVim for Windows and executing :%!xxd on Windows I get:
> 61 0D 0A 61
> So 61 is letter a, 0D is a carriage return and 0A is new line. So file was automatically converted from Unix EOL file format to Windows EOL format.
>
> 7. But when I save a file on gVim on Windows with :w and check the file on vim for Linux with :%!xxd command I see Windows EOL file format has preserved.
>
>
> How to make this EOL conversion to work without a problem between Windows and Linux using gVim?

Vim doesn't do any automatic conversion between line-ending formats. If you are having problems with an automated conversion, the root cause is probably your SCP tool, not Vim. Check the configuration of that tool for options regarding line endings.

That said, Vim itself should have no problem at all handling either file format.

So what problem are you seeing? What is the "end of line" character problem you're seeing?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment