Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it able to change the bg color of the which-key and floating windows? #430

Closed
2 tasks done
c02y opened this issue Aug 24, 2019 · 4 comments
Closed
2 tasks done

Comments

@c02y
Copy link
Contributor

c02y commented Aug 24, 2019

Before you continue, ensure you have read the README and wiki carefully. Note that low quality issue feedback might be closed directly.

Environment

Please complete these steps and check these boxes (by putting an x inside
the brackets) before filing your issue:

  • OS:
    • Linux
    • [] macOS
    • [] Windows
    • [] FreeBSD
  • Vim:
    • [] Terminal Vim
    • [] GVim
    • NeoVim

Put the contents of :version below:

:version
NVIM v0.4.0-1800-g82aaac5ba
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99
 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32
-DNVIM_UNIBI_HAS_VAR_FROM -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/
build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/includ
e
Compiled by travis@travis-job-29423c5b-eb31-423b-902e-cca2c78175e5

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/home/travis/build/neovim/bot-ci/build/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

Put the contents of :SpaceInfo below:

    Current FileType:
    Global Variables:
    let g:spacevim = {
        base = '/home/chz/.space-vim',
        excluded = ['ntpeters/vim-better-whitespace', 'tpope/vim-rsi', 'mhinz/vim-signify'],
        gui = 0,
        info = '/home/chz/.space-vim/core/autoload/spacevim/info.vim',
        layers_base = '/layers',
        loaded = ['spacevim', 'fzf', 'better-defaults', 'which-key', 'auto-completion', 'c-c++', 'git', 'editing', 'python', 'better-motion', 'airline', 'cscope', 'lsp', 'tex
t-align'],
        manifest = {'syntax-checking': {'dir': '/home/chz/.space-vim/layers/+checkers/syntax-checking'}, 'spacevim': {'dir': '/home/chz/.space-vim/layers/+distributions/space
vim'}, 'solidity': {'dir': '/home/chz/.space-vim/layers/+lang/solidity'}, 'go': {'dir': '/home/chz/.space-vim/layers/+lang/go'}, 'code-snippets': {'dir': '/home/chz/.space-vi
m/layers/+programming/code-snippets'}, 'graphviz': {'dir': '/home/chz/.space-vim/layers/+lang/graphviz'}, 'ctrlp': {'dir': '/home/chz/.space-vim/layers/+vim/ctrlp'}, 'git': {
'dir': '/home/chz/.space-vim/layers/+version-control/git'}, 'github': {'dir': '/home/chz/.space-vim/layers/+version-control/github'}, 'lightline': {'dir': '/home/chz/.space-v
im/layers/+themes/lightline'}, 'games': {'dir': '/home/chz/.space-vim/layers/+fun/games'}, 'java': {'dir': '/home/chz/.space-vim/layers/+lang/java'}, 'javascript': {'dir': '/
home/chz/.space-vim/layers/+lang/javascript'}, 'scala': {'dir': '/home/chz/.space-vim/layers/+lang/scala'}, 'auto-completion': {'dir': '/home/chz/.space-vim/layers/+completio
n/auto-completion'}, 'ruby': {'dir': '/home/chz/.space-vim/layers/+lang/ruby'}, 'emoji': {'dir': '/home/chz/.space-vim/layers/+fun/emoji'}, 'file-manager': {'dir': '/home/chz
/.space-vim/layers/+tools/file-manager'}, 'typescript': {'dir': '/home/chz/.space-vim/layers/+lang/typescript'}, 'lsp': {'dir': '/home/chz/.space-vim/layers/+tools/lsp'}, 'do
cker': {'dir': '/home/chz/.space-vim/layers/+tools/docker'}, 'deoplete': {'dir': '/home/chz/.space-vim/layers/+completion/deoplete'}, 'programming': {'dir': '/home/chz/.space
-vim/layers/+programming/programming'}, 'chinese': {'dir': '/home/chz/.space-vim/layers/+misc/chinese'}, 'which-key': {'dir': '/home/chz/.space-vim/layers/+vim/which-key'}, '
ycmd': {'dir': '/home/chz/.space-vim/layers/+tools/ycmd'}, 'formatting': {'dir': '/home/chz/.space-vim/layers/+programming/formatting'}, 'html': {'dir': '/home/chz/.space-vim
/layers/+lang/html'}, 'better-defaults': {'dir': '/home/chz/.space-vim/layers/+distributions/better-defaults'}, 'text-align': {'dir': '/home/chz/.space-vim/layers/+vim/text-a
lign'}, 'vue': {'dir': '/home/chz/.space-vim/layers/+lang/vue'}, 'goyo': {'dir': '/home/chz/.space-vim/layers/+fun/goyo'}, 'better-motion': {'dir': '/home/chz/.space-vim/laye
rs/+vim/better-motion'}, 'python': {'dir': '/home/chz/.space-vim/layers/+lang/python'}, 'cscope': {'dir': '/home/chz/.space-vim/layers/+tools/cscope'}, 'airline': {'dir': '/h
ome/chz/.space-vim/layers/+themes/airline'}, 'elm': {'dir': '/home/chz/.space-vim/layers/+lang/elm'}, 'clojure': {'dir': '/home/chz/.space-vim/layers/+lang/clojure'}, 'unite'
: {'dir': '/home/chz/.space-vim/layers/+completion/unite'}, 'wasm': {'dir': '/home/chz/.space-vim/layers/+lang/wasm'}, 'editing': {'dir': '/home/chz/.space-vim/layers/+progra
mming/editing'}, 'latex': {'dir': '/home/chz/.space-vim/layers/+lang/latex'}, 'markdown': {'dir': '/home/chz/.space-vim/layers/+lang/markdown'}, 'c-c++': {'dir': '/home/chz/.
space-vim/layers/+lang/c-c++'}, 'erlang': {'dir': '/home/chz/.space-vim/layers/+lang/erlang'}, 'ctags': {'dir': '/home/chz/.space-vim/layers/+tools/ctags'}, 'rust': {'dir': '
/home/chz/.space-vim/layers/+lang/rust'}, 'haskell': {'dir': '/home/chz/.space-vim/layers/+lang/haskell'}, 'elixir': {'dir': '/home/chz/.space-vim/layers/+lang/elixir'}, 'tmu
x': {'dir': '/home/chz/.space-vim/layers/+tools/tmux'}, 'fzf': {'dir': '/home/chz/.space-vim/layers/+tools/fzf'}},
        nvim = 1,
        os = {'linux': 1, 'windows': 0, 'mac': 0},
        plugins = ['liuchengxu/space-vim-dark', 'liuchengxu/space-vim-theme', 'liuchengxu/vim-better-default', 'junegunn/fzf', 'junegunn/fzf.vim', 'tpope/vim-rsi', 'kshenoy/v
im-signature', 'dominikduda/vim_current_word', 't9md/vim-choosewin', 'ntpeters/vim-better-whitespace', 'haya14busa/is.vim', 'osyo-manga/vim-anzu', 'liuchengxu/vim-which-key',
 'ncm2/ncm2', 'roxma/nvim-yarp', 'ncm2/ncm2-bufword', 'ncm2/ncm2-tmux', 'ncm2/ncm2-path', 'ncm2/ncm2-jedi', 'ncm2/ncm2-github', 'ncm2/ncm2-racer', 'ncm2/ncm2-go', 'ncm2/ncm2-
pyclang', 'ncm2/ncm2-vim', 'Shougo/neco-vim', 'ncm2/float-preview.nvim', 'rhysd/vim-clang-format', 'octol/vim-cpp-enhanced-highlight', 'junegunn/gv.vim', 'tpope/vim-fugitive'
, 'mhinz/vim-signify', 'tpope/vim-surround', 'pelodelfuego/vim-swoop', 'terryma/vim-multiple-cursors', 'scrooloose/nerdcommenter', 'jiangmiao/auto-pairs', 'jeetsukumaran/vim-
pythonsense', 'python-mode/python-mode', 'unblevable/quick-scope', 'justinmk/vim-sneak', 'easymotion/vim-easymotion', 'haya14busa/incsearch-easymotion.vim', 'vim-airline/vim-
airline-themes', 'vim-airline/vim-airline', 'romainl/vim-qf', 'autozimu/LanguageClient-neovim', 'godlygeek/tabular', 'junegunn/vim-easy-align'],
        private_base = '/private',
        speed_up_via_timer = 0,
        timer = 1,
        tmux = 1,
        topics = {'+vim': ['better-motion', 'ctrlp', 'text-align', 'which-key'], '+themes': ['airline', 'lightline'], '+tools': ['cscope', 'ctags', 'docker', 'file-manager',
'fzf', 'lsp', 'tmux', 'ycmd'], '+misc': ['chinese'], '+completion': ['auto-completion', 'deoplete', 'unite'], '+distributions': ['better-defaults', 'spacevim'], '+version-con
trol': ['git', 'github'], '+fun': ['emoji', 'games', 'goyo'], '+lang': ['c-c++', 'clojure', 'elixir', 'elm', 'erlang', 'go', 'graphviz', 'haskell', 'html', 'java', 'javascrip
t', 'latex', 'markdown', 'python', 'ruby', 'rust', 'scala', 'solidity', 'typescript', 'vue', 'wasm'], '+programming': ['code-snippets', 'editing', 'formatting', 'programming'
], '+checkers': ['syntax-checking']},
        version = '0.9.0',
        vim8 = 0,
    }
    let g:spacevim#map#leader#desc = {
          = {'c': ['tabclose', 'close-current-tab'], '1': 'tab-1', '2': 'tab-2', '3': 'tab-3', '4': 'tab-4', 'name': '+tab', '6': 'tab-6', '7': 'tab-7', '8': 'tab-8', '9': 't
ab-9', '5': 'tab-5'},
        1 = 'window-1',
        2 = 'window-2',
        3 = 'window-3',
        4 = 'window-4',
        5 = 'window-5',
        6 = 'window-6',
        7 = 'window-7',
        8 = 'window-8',
        9 = 'window-9',
        ; = ['<Plug>NERDCommenterToggle', 'commenter'],
        ? = ['Maps', 'show-keybindings'],
        Q = ['qa!', 'quit-without-saving'],
        os = {'linux': 1, 'windows': 0, 'mac': 0},
        plugins = ['liuchengxu/space-vim-dark', 'liuchengxu/space-vim-theme', 'liuchengxu/vim-better-default', 'junegunn/fzf', 'junegunn/fzf.vim', 'tpope/vim-rsi', 'kshenoy/v
im-signature', 'dominikduda/vim_current_word', 't9md/vim-choosewin', 'ntpeters/vim-better-whitespace', 'haya14busa/is.vim', 'osyo-manga/vim-anzu', 'liuchengxu/vim-which-key',
 'ncm2/ncm2', 'roxma/nvim-yarp', 'ncm2/ncm2-bufword', 'ncm2/ncm2-tmux', 'ncm2/ncm2-path', 'ncm2/ncm2-jedi', 'ncm2/ncm2-github', 'ncm2/ncm2-racer', 'ncm2/ncm2-go', 'ncm2/ncm2-
pyclang', 'ncm2/ncm2-vim', 'Shougo/neco-vim', 'ncm2/float-preview.nvim', 'rhysd/vim-clang-format', 'octol/vim-cpp-enhanced-highlight', 'junegunn/gv.vim', 'tpope/vim-fugitive'
, 'mhinz/vim-signify', 'tpope/vim-surround', 'pelodelfuego/vim-swoop', 'terryma/vim-multiple-cursors', 'scrooloose/nerdcommenter', 'jiangmiao/auto-pairs', 'jeetsukumaran/vim-
pythonsense', 'python-mode/python-mode', 'unblevable/quick-scope', 'justinmk/vim-sneak', 'easymotion/vim-easymotion', 'haya14busa/incsearch-easymotion.vim', 'vim-airline/vim-
airline-themes', 'vim-airline/vim-airline', 'romainl/vim-qf', 'autozimu/LanguageClient-neovim', 'godlygeek/tabular', 'junegunn/vim-easy-align'],
        private_base = '/private',
        speed_up_via_timer = 0,
        timer = 1,
        tmux = 1,
        topics = {'+vim': ['better-motion', 'ctrlp', 'text-align', 'which-key'], '+themes': ['airline', 'lightline'], '+tools': ['cscope', 'ctags', 'docker', 'file-manager',
'fzf', 'lsp', 'tmux', 'ycmd'], '+misc': ['chinese'], '+completion': ['auto-completion', 'deoplete', 'unite'], '+distributions': ['better-defaults', 'spacevim'], '+version-con
trol': ['git', 'github'], '+fun': ['emoji', 'games', 'goyo'], '+lang': ['c-c++', 'clojure', 'elixir', 'elm', 'erlang', 'go', 'graphviz', 'haskell', 'html', 'java', 'javascrip
t', 'latex', 'markdown', 'python', 'ruby', 'rust', 'scala', 'solidity', 'typescript', 'vue', 'wasm'], '+programming': ['code-snippets', 'editing', 'formatting', 'programming'
], '+checkers': ['syntax-checking']},
        version = '0.9.0',
        vim8 = 0,
    }
    let g:spacevim#map#leader#desc = {
          = {'c': ['tabclose', 'close-current-tab'], '1': 'tab-1', '2': 'tab-2', '3': 'tab-3', '4': 'tab-4', 'name': '+tab', '6': 'tab-6', '7': 'tab-7', '8': 'tab-8', '9': 't
ab-9', '5': 'tab-5'},
        1 = 'window-1',
        2 = 'window-2',
        3 = 'window-3',
        4 = 'window-4',
        5 = 'window-5',
        6 = 'window-6',
        7 = 'window-7',
        8 = 'window-8',
        9 = 'window-9',
        ; = ['<Plug>NERDCommenterToggle', 'commenter'],
        ? = ['Maps', 'show-keybindings'],
        Q = ['qa!', 'quit-without-saving'],
        os = {'linux': 1, 'windows': 0, 'mac': 0},
        plugins = ['liuchengxu/space-vim-dark', 'liuchengxu/space-vim-theme', 'liuchengxu/vim-better-default', 'junegunn/fzf', 'junegunn/fzf.vim', 'tpope/vim-rsi', 'kshenoy/v
im-signature', 'dominikduda/vim_current_word', 't9md/vim-choosewin', 'ntpeters/vim-better-whitespace', 'haya14busa/is.vim', 'osyo-manga/vim-anzu', 'liuchengxu/vim-which-key',
 'ncm2/ncm2', 'roxma/nvim-yarp', 'ncm2/ncm2-bufword', 'ncm2/ncm2-tmux', 'ncm2/ncm2-path', 'ncm2/ncm2-jedi', 'ncm2/ncm2-github', 'ncm2/ncm2-racer', 'ncm2/ncm2-go', 'ncm2/ncm2-
pyclang', 'ncm2/ncm2-vim', 'Shougo/neco-vim', 'ncm2/float-preview.nvim', 'rhysd/vim-clang-format', 'octol/vim-cpp-enhanced-highlight', 'junegunn/gv.vim', 'tpope/vim-fugitive'
, 'mhinz/vim-signify', 'tpope/vim-surround', 'pelodelfuego/vim-swoop', 'terryma/vim-multiple-cursors', 'scrooloose/nerdcommenter', 'jiangmiao/auto-pairs', 'jeetsukumaran/vim-
pythonsense', 'python-mode/python-mode', 'unblevable/quick-scope', 'justinmk/vim-sneak', 'easymotion/vim-easymotion', 'haya14busa/incsearch-easymotion.vim', 'vim-airline/vim-
airline-themes', 'vim-airline/vim-airline', 'romainl/vim-qf', 'autozimu/LanguageClient-neovim', 'godlygeek/tabular', 'junegunn/vim-easy-align'],
        private_base = '/private',
        speed_up_via_timer = 0,
        timer = 1,
        tmux = 1,
        topics = {'+vim': ['better-motion', 'ctrlp', 'text-align', 'which-key'], '+themes': ['airline', 'lightline'], '+tools': ['cscope', 'ctags', 'docker', 'file-manager',
'fzf', 'lsp', 'tmux', 'ycmd'], '+misc': ['chinese'], '+completion': ['auto-completion', 'deoplete', 'unite'], '+distributions': ['better-defaults', 'spacevim'], '+version-con
trol': ['git', 'github'], '+fun': ['emoji', 'games', 'goyo'], '+lang': ['c-c++', 'clojure', 'elixir', 'elm', 'erlang', 'go', 'graphviz', 'haskell', 'html', 'java', 'javascrip
t', 'latex', 'markdown', 'python', 'ruby', 'rust', 'scala', 'solidity', 'typescript', 'vue', 'wasm'], '+programming': ['code-snippets', 'editing', 'formatting', 'programming'
], '+checkers': ['syntax-checking']},
        version = '0.9.0',
        vim8 = 0,
    }
    let g:spacevim#map#leader#desc = {
          = {'c': ['tabclose', 'close-current-tab'], '1': 'tab-1', '2': 'tab-2', '3': 'tab-3', '4': 'tab-4', 'name': '+tab', '6': 'tab-6', '7': 'tab-7', '8': 'tab-8', '9': 't
ab-9', '5': 'tab-5'},
        1 = 'window-1',
        2 = 'window-2',
        3 = 'window-3',
        4 = 'window-4',
        5 = 'window-5',
        6 = 'window-6',
        7 = 'window-7',
        8 = 'window-8',
        9 = 'window-9',
        ; = ['<Plug>NERDCommenterToggle', 'commenter'],
        ? = ['Maps', 'show-keybindings'],
        Q = ['qa!', 'quit-without-saving'],

Problem Description

Currently when I'm using the feature of which-key or fzf, the background color of popup window is very ugly, is it able to change it?

which-key
fzf

@liuchengxu
Copy link
Owner

See liuchengxu/vim-which-key#58

@c02y
Copy link
Contributor Author

c02y commented Aug 26, 2019

You mean like this?

    if exists('&winhighlight')
        setlocal winhighlight=NormalFloat:WhichKeyFloating
    endif

It indeed changes the bg of the which-key, but is it the same as the theme (I disable the theme when using vim/nvim in terminal, so the theme here is the theme of the terminal), check the screenshot, I cannot distinguish the text in the buffer and the text in which-key popup window.

And the bg color of the floating window for fzf is still the same, check the screenshots.

I tried other configs in ~/.spacevim, none of them works, it seems it is fixed, either the same of the theme or the ugly color in the screenshot.

I want the bg of color for both which-key and floating window of fzf to be like #395 (comment) ,just slightly different from the theme.
What can I do?

which-key
floatwindow

@liuchengxu
Copy link
Owner

liuchengxu commented Aug 26, 2019

Your problem is mostly that you chose a wrong theme or you did something wrong in your .spacevim . Normally the highlight group of the floating window is linked to Pmenu by default. If you do love your current theme, you can try customizing the highlight by yourself:

hi link WhichKeyFloating Search

Also search the vim help :h hi.

@c02y
Copy link
Contributor Author

c02y commented Aug 27, 2019

I found the problem:
I'm using the following configuration:

    " disable theme in terminal vim
    if !has("gui_running")
        colorscheme default
    endif

Once I comment this part out, the bg color of which-key and floatwindow of fzf is quite normal.

And

hi link WhichKeyFloating Search

only affects for the bg color of which-key window, not for the bg color of floatwindow of fzf.

I have to redefine Pmenu, after some tests, this is what I'll use:

    " disable theme in terminal vim
    if !has("gui_running")
        colorscheme default
        " for which-key and floatwindow of fzf
        highlight Pmenu guibg=#3A3A3A
    endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants