junegunn / fzf.vim

fzf :heart: vim
MIT License
9.55k stars 583 forks source link

Preview window changed as 'purple'(color inversion?) after migration from vim to 'neovim' #1431

Closed flavono123 closed 1 year ago

flavono123 commented 1 year ago
❯ sw_vers
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115

❯ nvim --version
NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Monterey

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

        시스템 vimrc 파일: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.8.0/share/nvim"

Run :checkhealth for more info

❯ vim --version
VIM - Vi IMproved 9.0 (2022 Jun 28, 빌드한 날짜 Sep 01 2022 15:00:53)
macOS 버젼 - x86_64
포함된 패치: 1-350
Compiled by Homebrew
Huge 버젼 GUI 없음.  기능 (+: 포함됨, -: 포함 안 됨):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       -tcl
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
-balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
-browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl              +title
+channel           +ipv6              +persistent_undo   -toolbar
+cindent           +job               +popupwin          +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3           +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby              +wildignore
+cursorbind        +lua               +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con        +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            -X11
+digraphs          +mouse             -sound             -xfontset
-dnd               -mouseshape        +spell             -xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        -mouse_gpm         +statusline        -xsmp
+eval              -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary
-farsi             -mouse_sysmouse    -tag_old_static
        시스템 vimrc 파일: "$VIM/vimrc"
        사용자 vimrc 파일: "$HOME/.vimrc"
 사용자 두 번째 vimrc 파일: "~/.vim/vimrc"
         사용자 exrc 파일: "$HOME/.exrc"
       defaults 파일: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
컴파일: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
링크: clang -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o vim -lm -lncurses -liconv -lintl -framework AppKit -L/usr/local/opt/lua/lib -llua5.4 -mmacosx-version-min=12.4 -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/perl/lib/perl5/5.34/darwin-thread-multi-2level/CORE -lperl -L/usr/local/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/config-3.10-darwin -lpython3.10 -framework CoreFoundation -lruby.3.1 -L/usr/local/Cellar/ruby/3.1.2_1/lib

I use MacOS and NeoVim, downloaded from Homebrew, with configs like this, just copy from when I used in vim:

command! -bang -nargs=* Rg
  \ call fzf#vim#grep(
  \   'rg --column --line-number --no-heading --color=always --smart-case -L --no-ignore-vcs -- '.shellescape(<q-args>), 1,
  \   fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}), <bang>0)

No problem in the vim but the background color is turned to purple in the neovim.

image

Why the color is different in neovim?

felixzieger commented 1 year ago

Try to do :highlight NormalFloat ctermfg=LightGrey as suggested in https://github.com/nvim-telescope/telescope.nvim/issues/2145#issuecomment-1264323345.

More information: https://neovim.discourse.group/t/how-to-configure-floating-window-colors-highlighting-in-0-8/3193/2

flavono123 commented 1 year ago

Thanks @felixzieger. I realized that it's about the Neovim's default highlight for NormalFloat, not the fzf's issue. (Asked on the same issue to neovim's repo https://github.com/neovim/neovim/issues/20698)