Search code examples
macosvimvim-pluginneovim

Neovim display issue on Mac OS X


I usually using Neovim on my Linux configurations but today I have to use a Mac and I'm gonna have to use it for a moment ...

So I installed the package manager Homebrew and installed Neovim. I put my configuration (init.vim) and install Vim-Plug plugins manager. I installed my plugins, all worked fine !

When I restarted Neovim I had a display issue ... The background is blue.

There is the link to show the background problem: https://i.sstatic.net/qSvgw.jpg

There is my usual color scheme : https://github.com/rakr/vim-one/blob/master/screenshots/new-logo.png

Here's the part of the config file for the color scheme :

    Plug 'rakr/vim-one'
    autocmd ColorScheme one let g:airline_theme='one'

call plug#end()

if (empty($TMUX))
  if (has("nvim"))
  "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
  let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  endif
  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  if (has("termguicolors"))
    set termguicolors
  endif
endif

colorscheme one
set background=dark

I'm not an expert on Mac I must have missed something but I can't figure out what.

Some help would be really appreciated. If you need more details I remain at your disposal.

Thank you :)


Solution

  • Unfortunately, the default terminal.app in Mac does not support true colors. If you have set termguicolors in your config, the colorscheme you use may be displayed wrongly. You have two options:

    • Stick with terminal.app and use set notermguicolors in your config.
    • Use other terminal applications which support true colors, such as iterm, kitty or alacritty. Set nvim to use true colors: set termguicolors