itchyny / vim-cursorword

Underlines the word under the cursor

Home Page:http://www.vim.org/scripts/script.php?script_id=5100

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unnecessary white background of cursorword appear when set cursorline

imuxin opened this issue · comments

  • Disable cursorline

.vimrc

" set cursorline

Result:
disable_cursorline

  • Enable cursorline

.vimrc

set cursorline
highlight CursorLine cterm=none ctermfg=None
highlight Visual cterm=bold ctermbg=202 ctermfg=NONE

Result:
enable_cursorline

I don't want the white background appear. How could I to hide or make it transparent?

What's the output of :highlight CursorLine and :highlight CursorWord1?

I am not clear about the .vimrc status what "highlight xxx" commands are based on. I can show you my entire vimrc file content. You can test on your local environment.

scriptencoding utf-8
set encoding=utf-8
set nocompatible
set termguicolors
syntax enable
syntax on

set cursorline
highlight CursorLine cterm=none ctermfg=None
highlight Visual cterm=bold ctermbg=202 ctermfg=NONE


"+-----------------------+
"| VundleVim.vim configs |
"+-----------------------+

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

Plugin 'itchyny/vim-cursorword'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

I can't still reproduce the issue. Please let me know the output of executing :highlight CursorLine and :highlight CursorWord1 from the command line.

Caused by termguicolors?

:highlight CursorLine
1


:highlight CursorWord1
2

Unset termguicolors

:highlight CursorLine
3


:highlight CursorWord1
4

You don't set the guibg of CursorLine in your vimrc but it seems that it is set lazily somewhere. Adding guibg=Grey40 to highlight CursorLine should fix this.

It works! Thanks!