vim should have "set bg=dark" by default

Bug #871907 reported by Mark Russell
This bug affects 9 people
Affects Status Importance Assigned to Milestone
vim (Ubuntu)

Bug Description

The default GNOME Terminal settings have a dark background. When syntax highlighting is active, the text is difficult to read. The default vim settings should work better with the default terminal settings.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in vim (Ubuntu):
status: New → Confirmed
Revision history for this message
Mark Russell (marrusl) wrote :

This is also true of ttys.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

I'm hesitant to "fix" this bug, even though it affects me. There are probably almost as many users with light background terminals as there are with dark ones. So we'll just be exchanging 1 set of affected users for another set.

Seems like we would need need to extend terminal applications to be able to respond with whether they are dark or light. One simple way to do that would simply be to introduce xterm-light and xterm-dark into the global termcap database, and then have the terminals respond with that based on a checkbox.

Revision history for this message
Mark Russell (marrusl) wrote :

I understand what you mean, Clint. That's true. But I disagree on the size of the two groups. I'd be willing to bet we'd be exchanging a large group for a significantly smaller one. You really can't underestimate how many people, even technical people, stick with the defaults. I think there are way more people using dark terminals on Ubuntu than light.

Of course, I have no real evidence, other than the fact it comes up at least once at every sprint I go to.... you start editing conf files on the projector and someone says: "hey would you please set bg=dark???"

I'm going to do some informal sampling at UDS next week. :)

Mark Russell (marrusl)
description: updated
Changed in vim (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

It's a matter of consistency. Our terminal by default has a dark background. Our vim configuration by default isn't set for a dark background.

Revision history for this message
Michael Bienia (geser) wrote :

I'm thinking about adding the following settings when I merge vim the next time:
- Add "bg=dark" to /etc/vim/vimrc
- Add "bg=light" to /etc/vim/gvimrc

Based on the last comment and my incomplete sampling with Ubuntu precise (dark background in gnome terminal and light background when using gvim).
It would be nice if someone could confirm (or reject) that these settings are a sane default for everyone (or at least most of Ubuntu, Kubuntu, Xubuntu, etc.).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vim - 2:7.3.429-2ubuntu1

vim (2:7.3.429-2ubuntu1) precise; urgency=low

  * Merge with Debian testing/unstable (lp: #927642). Remaining changes:
    - debian/runtime/
      + Add Launchpad integration to the Help menu if launchpad-integration is
    - debian/runtime/vimrc:
      + "syntax on" is a sane default for non-tiny vim
    - debian/patches/debian/ubuntu-grub-syntax.patch:
      + Add Ubuntu-specific "quiet" keyword.
  * debian/runtime/vimrc, debian/runtime/gvimrc:
    Set background=dark for vim and background=light for gvim (lp: #871907)

vim (2:7.3.429-2) unstable; urgency=low

  * Ignore failures in test61 since it is highly sensitive to timing.
    Slow/heavily loaded systems will cause the test to fail.
  * Install bug scripts with correct permissions.
    + Use dh_bugfiles to simplify process
    + Bump debhelper B-D to >= 7.2.3~

vim (2:7.3.429-1) unstable; urgency=low

  * Pull upstream tag v7-3-429
    + Updated sshconfig syntax file. (Closes: #594296)
    + 7.3.365: Fix crash when using a large Unicode character with syntax
      highlighting. (Closes: #657777)
  * Add new education and introspection sections to debcontrol syntax file.
    (Closes: #651381)
  * Update vim-common's mime information to handle only having vim-tiny
    installed. (Closes: #654674)
    + Add test -x /usr/bin/vim for the vim entries.
    + Add lower-priority vi entries.
  * Use new --enable-fail-if-missing flag to make configure fail if an
    interpreter is enabled but configure test fails.
  * Add bug script to show what binaries the vi/vim/gvim symlinks point to.
  * Only use /u/s/dpkg/ when available.
    + Reduce versioned B-D on dpkg-dev
    + Manually set relevant makefile variables if file isn't present
  * Add alternate libncurses5-dev B-D to ease backporting.

vim (2:7.3.363-1) unstable; urgency=low

  * Pull upstream tag v7-3-363
    + 7.3.358: Fix mouse handling since urxvt support. (Closes: #647055)
  * Set vim-lesstif's section to oldlibs, as suggested by
 -- Michael Bienia <email address hidden> Sun, 26 Feb 2012 15:26:29 +0100

Changed in vim (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

FWIW, it wasn't easy to find out why colors in vim suddenly broke and were almost unreadable in a terminal with bright background.

Bright text on a dark background is an ergonomical sin, and a technical nonsense on top of it if you are using a TFT screen (and who doesn't..)

Revision history for this message
Mathieu Comandon (strycore) wrote :

It took me some time to figure out why my vim config suddently broke.
When I open gvim, the colorscheme should be set to molokai but it reverts to default. It turns out that if I revert the background to dark in /etc/vim/gvimrc.
I could easily change this behavior if I used a ~/.gvimrc config file but I prefer having a single config file with a if has('gui_running') statement, the problem is that the config setting in /etc/vim/gvimrc overrides my ~/.vimrc

Is it really necessary to set a light background in gvim ? Pretty much every colorscheme of vimrcs I've seen use a dark background, so why not keep gvim the same as vim ?

Revision history for this message
Michael Bienia (geser) wrote :

As this cause trouble with colorschemes (see bug #951440), I'm undoing both changes again.

Undoing only the change to /etc/vim/gvimrc isn't enough as people would get background=dark in gvim if they don't use a colorscheme which changes their background colour (or a colorscheme at all) and as gvim uses a light background by default it results in hard to read colours (e.g. yellow on white).

As I don't see currently a good solution on how to fix it, I'm re-opening this bug again and setting it to "Opinion".

Changed in vim (Ubuntu):
status: Fix Released → Opinion
Revision history for this message
Mark Russell (marrusl) wrote :

I see your dilemma, but dark red on black is also pretty bad. I feel like one of the two is going to be hard to read by default. Why should that be vim? I would think that vim is used a lot more often then vim-gnome.

Particularly on cloud and server, where you are very frequently deploying new machines/instances, having "readable by default" vim in Precise has been fantastic.

information type: Public → Public Security
Junien Fridrick (axino)
information type: Public Security → Public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers