Thursday, October 2, 2014

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

On Wednesday, October 1, 2014 11:59:05 PM UTC+13, Igor Forca wrote:
...<line ending problems, diagnosed by converting to hex>...

If you have not done so, I suggest reading the help on 'ff' and 'ffs':

:help 'ff

I use a status line (:set laststatus=2) with an expression that warns me if the line endings are not unix ones:

set statusline=%<%f%1*%{&ff=~'u'?'':&ff}%*\ %h%m%r%=%-16.(%l,%2c\ \ %L%)\ %P

The bits about the line endings are

%1* set the highlighting to User1
%{&ff=~'u'?'':&ff} if the ff option doesn't have a u, show it
%* reset the highlighting back to the normal status line setting

This way I'm warned if vim reads a dos or mac file; in most colour schemes the status line has a contrasting background to the text and User1 doesn't, so the break in the background is noticeable.

Regards, John Little

--
--
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