Sunday, April 24, 2011

Re: vimdiff "-c next" breaks diff highlighting?

On 2011-04-23, Leho Kraav wrote:
> hi all
>
> i am stumped. using "-c next" and "-c prev" as arguments to vimdiff kills diff
> and syntax highlighting, or colorscheme, everything is just monocolor. "-c
> setlocal noma readonly" has no problems.
>
> is it a bug? what ways are there to gather some debug information about such an
> issue?
>
> non-working:
> $ vimdiff -c "saveas /tmp/rc.conf" -c next -c "setlocal noma readonly" -c prev
> /etc/rc.conf /etc/._cfg0000_rc.conf
>
> works:
> $ vimdiff -c "saveas /tmp/rc.conf" -c "setlocal noma readonly" /etc/rc.conf /
> etc/._cfg0000_rc.conf

:next means "edit the next file in the arglist". Vim loads the
current buffer with the contents of the next file in the arglist,
which turns off diff for that buffer.

That is probably not what you wanted to do. You probably wanted to
switch focus to the other diff window. You can do that with the
:wincmd command, e.g.,

-c "wincmd w"

See

:help wincmd
:help CTRL-W_w
:help window-move-cursor

Regards,
Gary

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

No comments:

Post a Comment