vim icon indicating copy to clipboard operation
vim copied to clipboard

Color for current line and visual blocks missing

Open welblaud opened this issue 4 years ago • 9 comments

Despite I have set cursoline highlighting up, there is no visible color. The same with visual block selections. The only clue about what is being selected is thanks to vim-indentline chars disappearing. (In gVim it works perfectly.)

  • it is run in terminal
  • bash 5.0.3
  • terminal 3.32.1-1ubuntu1
  • in terminal I tried to use Nord theme via Gogh or the basic system theme (it seems this may be the problem, it somehow overrides the colors)
  • it is run alone, without any multiplexer
  • Ubuntu 19.04
  • as I can remember, other themes were OK (gruvbox, space_vim_dark, etc.)

At the moment, I have no idea how to run bare-bones Vim with the nord theme without broking my .vim directory.

This is what I get with both nord theme in terminal and in vim (besides the current line highlighting problem, it seems all colors are distorted a bit too): obrazek

welblaud avatar Aug 21 '19 15:08 welblaud

Hi @welblaud, I need some more information regarding your setup (like mentioned in the issue template), otherwise there's no way trying to reproduce the problem:

  • Are you running in GUI or terminal mode?
    • If you're running in terminal mode, what's the name and version of your shell and terminal?
    • Are you within an terminal multiplexer like tmux or connected to an external system via SSH?
  • What is the operating system and version you're running?
  • Have you tried to reproduce the problem with a clean Vim configuration (e.g. no other plugins and customizations) that only loads and sets Nord as colorscheme?
    • If not, have you checked that there are no any other modifications in your vimrc that might cause this problem?
  • Is the problem reproducible using another theme?

Also, if you're using the st terminal the problem might be related to #166. If so please try to follow the steps that were done in the comments of #166 (setting the special variables) to see if this solves the problem.

arcticicestudio avatar Aug 21 '19 17:08 arcticicestudio

I am currently facing these issues running iTerm with Fish on MacOS, so it's definitely not an isolated issue.

image

Benjamin-Lee avatar Sep 03 '19 21:09 Benjamin-Lee

Terminal: simple terminal st Theme: patch nordtheme Application: Vim version 8.2.24 Colorscheme: nord OS: ElementaryOS Usually I don't use line highlighting but I tested it via :set cursorline and it works as expected: nord.png PS.

Note that setting the 'cursorline' or 'cursorcolumn' options can cause Vim to respond slowly, especially for large files or files with long lines.

dagolinuxoid avatar Mar 24 '20 08:03 dagolinuxoid

@dagolinuxoid Thanks for testing and sharing your results, looks like both problems are related to Vim's color space again.

@Benjamin-Lee @welblaud Could you please try to add the following option to your configuration? It looks like Vim uses the 256 color palette instead of the hexadecimal colors defined by Nord.

if (has("termguicolors"))
  set termguicolors
endif

arcticicestudio avatar Apr 07 '20 11:04 arcticicestudio

BTW unfortunately in some cases in order to enable true color support (make sure your terminal support it), using just set termguicolors isn't enough I managed to make it work by adding these lines into vimrc config file:

" set Vim-specific sequences for RGB colors | enable true colors
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors

dagolinuxoid avatar Apr 08 '20 10:04 dagolinuxoid

I've got the same problem using Windows Terminal. Settingset termguicolors does work and set cursorline now works, but now the integrated terminal in vim (using :term) has the wrong colors. Am I missing something?

galah92 avatar Jul 29 '20 18:07 galah92

I'd add the lines to the install guide so people are aware of the issue

MrSicario avatar Aug 07 '20 03:08 MrSicario

Confirming that adding the set termguicolors and set cursorline options makes this work for me. This really would be great to add to the installation instructions.

BenResTech avatar Jun 08 '21 13:06 BenResTech

It's documented in the readme that only true colours are supported.

jvoisin avatar Apr 16 '22 17:04 jvoisin