Monday, July 14, 2014

Re: RFE: honor 'eol' setting regardless of 'binary' flag.

On 2014-07-13 14:04, Linda W wrote:
> > Take Christian's advice: just put "set binary" in your vimrc and
> > be done with it. Anything more is just trolling the list.
> >
> ---
> set binary changes other settings that I don't want changed:
> The following options will be ignored:
> textwidth, wrapmargin, modeline, expandtab, fileformat, (and
> fileformats)

This is the first I've seen you mention that *this* is your actual
issue. So 'eol' and 'binary' work just fine for managing EOL, and
it's the jockeying of tw/wm/ml/et/ff that is at the root of your
concern? This should solve that issue:

function! DetectNoEOL()
if !&eol
au BufWritePre <buffer> let b:old_saved=[&tw,&wm,&ml,&et,&ff,&bin]|set bin noeol
au BufWritePost <buffer> :let [&tw,&wm,&ml,&et,&ff,&bin]=b:old_saved
endif
endfunction
augroup EOL
au!
au BufEnter * :call DetectNoEOL()
augroup END

My apologies for pushing the troll button when communication re.
the root-cause of your trouble was in play. For future reference, if
someone suggests that something might solve the problem, it would
help to answer (earlier) why that doesn't meet your needs. Armed
with the actual cause of your frustration ("using 'binary' messes with
other settings I want to keep"), that could have been addressed
straight-away.

-tim




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