#848 closed defect (worksforme)
background color autodetection in vim doesn't work.
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Book | Version: | CVS |
Severity: | normal | Keywords: | |
Cc: |
Description
Jeremy Utley says that the
set background=dark
statement is needed in /etc/vimrc. He explains the need for such a statement in the following way. Without this, the color for comments is deep blue, almost unreadable on Linux console, and with this option it is light-blue, well readable.
I agree that deep blue is unreadable on Linux console. I don't agree that comments are deep blue by default on Linux console. They become such when I explicitly set bg=light. I don't have any "set background" statement in /etc/vimrc.
Moreover, I can point to the source lines where the background color autodetection is supposed to happen: vim63/src/option.c, lines 2964 -- 3003.
The logic is: terminals with TERM=linux have dark background, everything else has light background.
However, Jeremy confirmed that on his Linux console TERM=linux and vim still thinks that the background is light.
Since these source lines don't work for Jeremy Utley and James Iwanek (LFS 5.1-pre), but work for me (LFS built in December 2003 according to NPTL hint, but with upgraded vim), it's a bug in the book.
Change History (3)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I can't reproduce this with vim-6.3 - here's some details:
--- bash-2.05b$ vim --version VIM - Vi IMproved 6.3 (2004 June 7, compiled Jun 19 2004 12:21:54) Compiled by root@lfs5 Normal version without GUI. Features included (+) or not (-): -arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv -cscope +dialog_con +diff +digraphs -dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist -keymap -langmap
+libcall +linebreak +lispindent +listcmds +localmap +menu +mksession
+modify_fname +mouse -mouseshape -mouse_dec +mouse_gpm -mouse_jsbterm -mouse_netterm +mouse_xterm +multi_byte +multi_lang -netbeans_intg -osfiletype +path_extra -perl +postscript +printer -python +quickfix -rightleft -ruby +scrollbind -signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 Linking: gcc -L/usr/local/lib -o vim -lncurses -lgpm -ldl bash-2.05b$ cat /etc/vimrc " Begin /etc/vimrc
set nocompatible set backspace=2 syntax on
(&term == "putty") |
set background=dark
endif
" End /etc/vimrc bash-2.05b$ cat $HOME/.vimrc cat: /home/matthew/.vimrc: No such file or directory bash-2.05b$ echo $TERM linux ---
Behaviour is as expected and described above (i.e. TERM=linux results in background=dark).
Just for reference: http://www.linuxfromscratch.org/pipermail/lfs-book/2004-May/010954.html and http://www.linuxfromscratch.org/pipermail/lfs-book/2004-June/011086.html contain threads related to this issue. I believe last time I checked I was seeing the same behaviour as Jeremy. I'll check again once I upgrade to vim-6.3.