On 2020-12-21, lacygoill wrote:
>     Personally, I think it should be automatically set to off upon entering
>     diff mode. You end up with two different sets of highlighting competing
>     with each other, the highlighting for the file type and the highlighting
>     for diff mode itself. It's always unreadable and the first thing I do 
> every
>     time I use diff mode is :syn off.
> 
> FWIW, I agree. That's why I ask Vim to clear the syntax when I'm in diff mode:
> 
> augroup NoSyntaxInDiffMode | au!
>     au OptionSet diff exe v:option_new == '1' ? 'syn clear' : 'do Syntax'
>     au VimEnter * IfDiffSynClear()
>     :def IfDiffSynClear()
>         if !&l:diff | return | endif
>         getwininfo()->map({_, v -> win_execute(v.winid, 'syn clear')})
>     enddef
> augroup END

I have a similar autocommand that sets syn=OFF whenever 'diff' is
set, but I also save the syntax state and restore it when 'diff' is
unset.

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20201221202958.GA24883%40phoenix.

Raspunde prin e-mail lui