The gruvbox colorscheme and syntax highlighting for C++ doesn't highlight some elements such as:
string
vector
I have this:
So I decided to change the colors manually using in init.vim
syn keyword Type string
syn keyword Type vector
This method didn't work.
When I run these commands myself while editing a file, I get the following change:
It works like a charm:
My goal is to automatically change colors for string
, vector
, cout
and many more keywords from init.vim
, because by default they are not highlighted by gruvbox.
- neovim version (nightly-nvim from AUR):
NVIM v0.5.0-dev+1391-g1df8a34a7
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
- neofetch:
In init.vim
I have:
filetype plugin indent on
syntax on
I have also tried the after-directory option. I placed a new file called after_init.vim
in these directories:
~/.config/nvim/after/after_init.vim
~/.config/nvim/after/syntax/after_init.vim
~/.vim/after/after_init.vim
~/.vim/after/syntax/after_init.vim
with:
syn keyword Type string
syn keyword Type vector
echon "im loaded after init.vim"
This also did not work.
I then also tried the autocommand option in init.vim
:
augroup ft_c
autocmd!
autocmd Syntax c syn keyword Type string
autocmd Syntax c syn keyword Type vector
augroup end
This didn't work.
syn
doesnt work ininit.vim
. i saw the option withafter directory
(check updated answer)