mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-08 03:13:47 -05:00
7
Usage
Daniel Etrata edited this page 2018-11-08 11:29:02 -06:00
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.