Results 1 to 9 of 9

Thread: Vi editor background color

  1. #1

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

  2. #2
    Join Date
    Jun 2008
    Location
    Florida, USA
    Posts
    970

    Default Re: Vi editor background color

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

    I suppose you can change that, perhaps running
    Code:
    vim -h
    will provide some hints.
    Desk: i7-4790K Leap 15.1(x86_64)4.12.14-lp151.28.7-default KF5 59.0 Plasma 5.14.4 Qt 5.13.0
    Lap: HPDV7T i7 Leap 15.0(x86_64)4.12.14-lp151.28.7-default KF5 59.0 Plasma 5.14.4 Qt 5.13.0

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,264
    Blog Entries
    2

    Default Re: Vi editor background color

    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

  4. #4

    Default Re: Vi editor background color

    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:

    Code:
    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.

  5. #5

    Default Re: Vi editor background color

    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.

  6. #6

    Default Re: Vi editor background color

    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.


  7. #7

    Default Re: Vi editor background color

    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?

  8. #8
    Join Date
    Jun 2008
    Location
    Florida, USA
    Posts
    970

    Default Re: Vi editor background color

    On my 13.1,
    Code:
    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/
    Desk: i7-4790K Leap 15.1(x86_64)4.12.14-lp151.28.7-default KF5 59.0 Plasma 5.14.4 Qt 5.13.0
    Lap: HPDV7T i7 Leap 15.0(x86_64)4.12.14-lp151.28.7-default KF5 59.0 Plasma 5.14.4 Qt 5.13.0

  9. #9

    Default Re: Vi editor background color

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •