0

in my init.vim (.vimrc) file i have this:

hi TerminalGreenColor guifg=#6bd676

function! EchoInitVimReloadedSuccessfully() echon " -- [ " echohl Identifier echon "init.vim" echohl None echon " ] reloaded " echohl TerminalGreenColor echon "successfully" echohl None echon " -- " endfunction

" reload vim with init.vim nnoremap <C-R> :source $init_vim_path<CR> :call EchoInitVimReloadedSuccessfully()<CR>

when i press CTRL + R it reloads the init.vim file successfully and echoes in the vim command-line row that it worked.

proof that is working:

proof

but my problem is that the word successfully its not colored with TerminalGreenColor(#6bd676)...

any ideas? thanks in advance.

alexzander
  • 113
  • 6
  • 1
    I copy pasted your code and it works for me with NVIM v0.5.0 and alacritty 0.8.0. Have you tried another terminal emulator? – statox Jun 08 '21 at 12:40
  • in the first place i used xfce-terminal (didnt work) and right now i tried in alacritty and it didnt work. – alexzander Jun 08 '21 at 13:24
  • Hm... Looks like it will be hard to help you debug that then... What does :verbose highlight TerminalGreenColor say? And what happen if you run manually :echohl TerminalGreenColor then :echo 'hello'? Also have you tried changing the properties of TerminalGreenColor to have an idea if the issue comes from the highlighting group itself or from somewhere else? – statox Jun 08 '21 at 14:08
  • :verbose highlight TerminalGreenColor -> TerminalGreenColor xxx cleared – alexzander Jun 08 '21 at 14:18
  • i tried printing the color directly in vim using :echohl, it worked. but i dont understand why it wouldnt from init.vim – alexzander Jun 08 '21 at 14:19
  • Ah here is your problem: :verbose highlight TerminalGreenColor is supposed to say something like TerminalGreenColor xxx guifg=#6bd676 Last set from ~/init.vim line XXX here it looks like something cleared your highlighting group which is why you don't see color changes so you're up for some debugging – statox Jun 08 '21 at 14:39
  • 1
    my guess is, that sourcing your init.vim file clears up the highlighting. Perhaps because of a :colorscheme command or :syntax command – Christian Brabandt Jun 08 '21 at 14:46
  • maybe it was cleared because i have echohl None before? but if dont put that still doesnt work. – alexzander Jun 08 '21 at 17:38

0 Answers0