Vi editor background color

Has anyone else noticed with 13.1 that the background color while using the vi editor no longer defaults to black and uses the background color of the terminal profile? I just upgraded to 13.1 from 12.3 and noticed this difference. I normally set my terminal profile appearance to black on random light colors. My shell is bash.

To be honest, I had not noticed but agree with your observation.

I suppose you can change that, perhaps running

vim -h

will provide some hints.

I’ve found only partly true.

I’ve found the background(and foreground) color also changes according to whatever Desktop you may or may not be running…
So, it appears to be a Desktop “feature” and not likely much to do with the underlying distro.

TSU

On 2014-02-27, kray42 <kray42@no-mx.forums.opensuse.org> wrote:
> Has anyone else noticed with 13.1 that the background color while using
> the vi editor no longer defaults to black and uses the background color
> of the terminal profile? I just upgraded to 13.1 from 12.3 and noticed
> this difference. I normally set my terminal profile appearance to black
> on random light colors. My shell is bash.

Please be accurate. Do you really mean vi or Vim? I use Vim and haven’t noticed this. I guarantee consistent colour
representation in my ~/.vimrc along the following lines:


color elflord
set background=dark
hi Normal guifg=white guibg=black

If on the other you really mean vi, then of course this solution won’t work.

I agree setting your background color from inside vim or with an init script is a workaround but wonder how this was overlooked. There doesn’t seem to be many posts on the web regarding the topic. Searching these forums also yielded little to no information regarding the change in behavior.

On 2014-02-27, kray42 <kray42@no-mx.forums.opensuse.org> wrote:
> I agree setting your background color from inside vim or with an init
> script is a workaround but wonder how this was overlooked. There doesn’t
> seem to be many posts on the web regarding the topic. Searching these
> forums also yielded little to no information regarding the change in
> behavior.

Well the question is whether Vim has changed colour inside a TTY virtual console since during the version transition. If
it hasn’t, then the underlying cause must be associated with a modification in the colour interaction of Vim inside
konsole or whatever X-based terminal you’re using. If it has, then it’s a change in the interaction of Vim inside bash,
which would be of concern.

Either way, you should keep yourself on the rails and have your own tailor-made ~/.vimrc. I would find it very
surprising to encounter a regular Vim user who doesn’t have a highly customised .vimrc file inside their personal $HOME
directory. For me, that configuration file affects 99% of the time I spend on a computer and so I make sure it’s
tailored to my needs.

The behavior applies to both vi and vim. And I would wager if you didn’t use .vimrc, you would see the same behavior using vim. I always use vi and while switching to vim with an init file would allow me to see what I want, the bigger question is why did this change between distros?

On my 13.1,

ll /bin/v*
lrwxrwxrwx 1 root root       3 Jan  4 16:59 /bin/vi -> vim
-rwxr-xr-x 1 root root 2342984 Oct 22 04:54 /bin/vim

If I recall correctly, vi has been a link to vim on oS for a long time (many releases)

But, I appear to have no .vimrc in my user directory.
So defaults I guess kick in.

I’m not sure I ever had a .vimrc.
And I always install/upgrade preserving my /home directory from prior releases.

I see that the vim package provides example .vimrc files in /usr/share/doc/packages/vim/

On 2014-02-27, cmcgrath5035 <cmcgrath5035@no-mx.forums.opensuse.org> wrote:
> If I recall correctly, vi has been a link to vim on oS for a long time
> (many releases)

This is correct. Also unfortunate IMO. Vim and vi are different programs. The first is charityware and the second is
not. It therefore does a disservice to the charityware community incorrectly calling Vim `vi’.

But, I appear to have no .vimrc in my user directory.
So defaults I guess kick in.

Yes - and it also defaults to vi-compatability mode if there’s no $HOME/.vimrc.

I’m not sure I ever had a .vimrc.
And I always install/upgrade preserving my /home directory from prior
releases.

I’m never sure how much of a good idea it is to preserve /home. I wipe it on every install/upgrade and have a
post-install script to set up all my .*rc files in $HOME.

I see that the vim package provides example .vimrc files in
/usr/share/doc/packages/vim/

There some really good examples if you search online. I’d say that looking at the .vimrc file of a regular Vim user is
like looking into his (or dare I say `her’) soul.