Kamaraju S Kusumanchi wrote:
consider
$ cat file.c
/* kamaraju
* kamaraju
* kamaraju
*/
kamaraju
I use konsole with black background and white foreground on Debian Etch,
vim 7.0.122
$ cat .vimrc
set hls
syn enable
With this configuration, if I do
set background=dark
and search for the word kamaraju, then text highlighted inside the comments
is very difficult to read. More over it is very difficult to see the cursor
(when it is inside the comments and on the word kamaraju) position.
Is there any way to use background=dark and hls together and edit a C file
(which includes comments) efficiently?
thanks
raju
If you don't set 'background' at all, what is the default? I would expect it
to be set to "dark" in your kind of console terminal. If it isn't try changing
your vimrc to
set hls bg=dark
sy on
or even to
set nocompatible
if ! has("gui_running")
set bg=dark
endif
runtime vimrc_example.vim
set hls
so that (in both cases) the 'background' option is set correctly before
turning syntax highlighting on.
When I use Vim on /dev/tty (pure-text console, default colors lightgrey on
black), 'background' is set to "dark" by default, and I get lightgrey on brown
as 'hlsearch' colours. In konsole, 'bg' is set to "light" by default, even in
a lightgrey-on-black scheme. If I set it to "dark" I still get Search
highlight in lightgrey on brown.
If that doesn't suit you, you can look into the colorschemes that come with
Vim (in $VIMRUNTIME/colors), those available at vim-online, or you can write
your own. It isn't hard: I'm appending a simple example.
See
:help :colorscheme
:view $VIMRUNTIME/colors/README.txt
Best regards,
Tony.
--
The New Testament offers the basis for modern computer coding theory,
in the form of an affirmation of the binary number system.
But let your communication be Yea, yea; nay, nay: for
whatsoever is more than these cometh of evil.
-- Matthew 5:37
" Vim color file
" Maintainer: Tony Mechelynck <[EMAIL PROTECTED]>
" Last Change: 2006 Sep 06
" ÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷
" This is almost the default color scheme. It doesn't define the Normal
" highlighting, it uses whatever the colors used to be.
" Only the few highlight groups named below are defined; the rest (most of
" them) are left at their compiled-in default settings.
" Set 'background' back to the default. The value can't always be estimated
" and is then guessed.
hi clear Normal
set bg&
" Remove all existing highlighting and set the defaults.
hi clear
" Load the syntax highlighting defaults, if it's enabled.
if exists("syntax_on")
syntax reset
endif
" Set our own highlighting settings
hi SpecialKey guibg=NONE
hi PyjamaEven ctermbg=grey gui=NONE guibg=#FFD8FF
" white on red is not always distinct in the GUI: use black on red then
hi Error guibg=red
guifg=black
hi clear ErrorMsg
hi link ErrorMsg Error
" show cursor line/column (if enabled) in very light grey in the GUI,
" underlined in the console
if has("gui_running")
hi clear CursorLine
hi CursorLine guibg=#F4F4F4
endif
hi clear CursorColumn
hi link CursorColumn CursorLine
" do not make help bars and stars invisible
hi clear helpBar
hi link helpBar helpHyperTextJump
hi clear helpStar
hi link helpStar helpHyperTextEntry
" the following were forgotten in the syntax/vim.vim (and ended up cleared)
hi clear vimVar
hi link vimVar Identifier
hi clear vimGroupName
hi link vimGroupName vimGroup
hi clear vimHiClear
hi link vimHiClear vimHighlight
" display the status line of the active window in a distinctive color:
" bold black on bright red in the GUI, white on green in the console (where the
bg is
" never bright, and dark red is sometimes an ugly sort of reddish brown).
hi StatusLine gui=NONE,bold guibg=red
guifg=black
\ cterm=NONE,bold ctermbg=green
ctermfg=white
" make the status line bold-reverse (but B&W) for inactive windows
hi StatusLineNC gui=reverse,bold
\ cterm=reverse,bold
" define colors for the tab line:
" file name of unselected tab
hi TabLine gui=NONE guibg=#EEEEEE
guifg=black
\ cterm=NONE,bold ctermbg=lightgrey
ctermfg=white
" file name of selected tab (GUI default is bold black on white)
hi TabLineSel cterm=NONE,bold ctermbg=green
ctermfg=white
" fillup and tab-delete "X" at right
hi TabLineFill gui=NONE,bold guibg=#CCCCCC
guifg=#990000
\ cterm=NONE ctermbg=lightgrey
ctermfg=red
" tab and file number 1:2/3 (meaning "tab 1: window 2 of 3) for selected tab
hi User1 gui=bold guibg=white
guifg=magenta
\ ctermbg=green
ctermfg=black
" tab and file number 1:2/3 for unselected tab
hi User2 guibg=#EEEEEE
guifg=magenta
\ ctermbg=lightgrey
ctermfg=black
" additional override for manpages à la Dr. Chip
hi manSubSectionStart guibg=white
guifg=yellow
\ ctermbg=black
ctermfg=darkblue
" remember the current colorscheme name
let colors_name = "almost-default"
" vim: sw=2