Tuesday, December 10, 2013

Re: Colors when opening a file where a swap file exists

On Tue, December 10, 2013 10:34, Martin Lundberg wrote:
> On Monday, December 9, 2013 7:00:47 PM UTC+1, Christian Brabandt wrote:
>> I think you are seeing the ConfirmMsg highlighting. If you see this
>> message when starting vim, the ConfirmMsg highlighting group might not
>> been set to its corresponding Colorscheme value, so it might change
>> later on.
>
> Not sure what you mean. I looked in my color file and I did not have a
> line for ConfirmMsg, I added it (as black) but terminal vim still shows me
> the same green message.

Sorry, I think, I meant the MoreMsg highlighting group. There is no
ConfirmMsg highlighting group.

What I mean is, if you see this message when starting vim or gvim,
then by that time, Vim hasn't adjusted the colors to the corresponding
colorscheme yet, simply because is hasn't sourced your colorscheme
yet, so it uses a compiled default, which might not match your
terminal. You can tell by provoking this message again, after Vim was
loaded, and see, if Vim uses a different color then.

What should work however is to reset the 'hl' setting by e.g.
vim --cmd "let &hl=substitute(&hl, 'm:[^,]*,', 'm:ErrorMsg,', '')"
foobar

This would use the 'ErrorMsg' highlighting everywhere where the
MoreMsg highlighting is used. I am not sure, this is actually wise to
do so, however.

But it might be easier to configure your terminal correctly. What
terminal are you using and what is your $TERM variable? It might
already help to force Vim to use a 't_Co' setting of 256, e.g. do an
export TERM=xterm-256colors
in your terminal (or whathever your shell needs)
This might also depend on your 'bg' setting.

For the gui, I am not sure, what will help there. Perhaps a .gtkrc file?

>> For the gui version, you can however work around it, by
>> removing the 'c' flag from the guioptions setting.
>
> I've actually added the 'c' flag myself because I don't want the GUI
> dialogs. However in MacVim the message is shown as Normal color with or
> without the ConfirmMsg highlight line.

Don't know about MacVim. But I suspect, MacVim is no problem for you
then?

> Is it actually my terminal that is showing the color as green? Maybe it
> can't be changed from Vim?

It can, but usually only when all startup scripts have been read
(which might not be the case when starting Vim with a filename and a
swapfile is found.

Best,
Christian

--
--
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/groups/opt_out.

No comments:

Post a Comment