Usage - morhetz/gruvbox GitHub Wiki

gruvbox comes in two modes, dark and light. To toggle between them just set background to an appropriate value:

set background=dark    " Setting dark mode
set background=light   " Setting light mode

If you have tpope's vim-unimpaired installed, you could easily switch with yob mapping.

Since gruvbox inverts cursor color, it could be awkward to determine current position, when the search is highlighted. To get single cursor color while searching, map these gruvbox functions somewhere after unimpaired is loaded:

nnoremap <silent> [oh :call gruvbox#hls_show()<CR>
nnoremap <silent> ]oh :call gruvbox#hls_hide()<CR>
nnoremap <silent> coh :call gruvbox#hls_toggle()<CR>

nnoremap * :let @/ = ""<CR>:call gruvbox#hls_show()<CR>*
nnoremap / :let @/ = ""<CR>:call gruvbox#hls_show()<CR>/
nnoremap ? :let @/ = ""<CR>:call gruvbox#hls_show()<CR>?

So you'll get g:gruvbox_hls_cursor (orange by default) cursor color when highlight search is on and inverted one otherwise.

⚠️ **GitHub.com Fallback** ⚠️