mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-16 07:13:46 -05:00
Additional functions
This commit is contained in:
36
README.md
36
README.md
@@ -44,16 +44,9 @@ Usage
|
|||||||
|
|
||||||
gruvbox comes in two modes, dark and light. To toggle between them with F5 you can add these to your .vimrc:
|
gruvbox comes in two modes, dark and light. To toggle between them with F5 you can add these to your .vimrc:
|
||||||
|
|
||||||
map <F5> :call ToggleBg()<CR>
|
map <silent> <F5> :call gruvbox#bg_toggle()<CR>
|
||||||
function! ToggleBg()
|
imap <silent> <F5> <ESC>:call gruvbox#bg_toggle()<CR>a
|
||||||
if &background == 'dark'
|
vmap <silent> <F5> <ESC>:call gruvbox#bg_toggle()<CR>gv
|
||||||
set bg=light
|
|
||||||
else
|
|
||||||
set bg=dark
|
|
||||||
endif
|
|
||||||
|
|
||||||
colo gruvbox
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
Just setting background to an appropriate value would work as well:
|
Just setting background to an appropriate value would work as well:
|
||||||
|
|
||||||
@@ -159,6 +152,29 @@ default: `0`
|
|||||||
Inverts indent guides. Could be nice paired with `set list` so it would highlight only tab symbols instead of it's background.
|
Inverts indent guides. Could be nice paired with `set list` so it would highlight only tab symbols instead of it's background.
|
||||||
default: `0`
|
default: `0`
|
||||||
|
|
||||||
|
Functions
|
||||||
|
---------
|
||||||
|
|
||||||
|
### gruvbox#bg_toggle()
|
||||||
|
|
||||||
|
(...)
|
||||||
|
|
||||||
|
### gruvbox#invert_signs_toggle()
|
||||||
|
|
||||||
|
(...)
|
||||||
|
|
||||||
|
### gruvbox#hls_show()
|
||||||
|
|
||||||
|
(...)
|
||||||
|
|
||||||
|
### gruvbox#hls_hide()
|
||||||
|
|
||||||
|
(...)
|
||||||
|
|
||||||
|
### gruvbox#hls_toggle()
|
||||||
|
|
||||||
|
(...)
|
||||||
|
|
||||||
Contributions
|
Contributions
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|||||||
27
autoload/gruvbox.vim
Normal file
27
autoload/gruvbox.vim
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
" -----------------------------------------------------------------------------
|
||||||
|
" File: gruvbox.vim
|
||||||
|
" Description: Retro groove color scheme for Vim
|
||||||
|
" Author: morhetz <morhetz@gmail.com>
|
||||||
|
" Source: https://github.com/morhetz/gruvbox
|
||||||
|
" Last Modified: 16 Dec 2013
|
||||||
|
" -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function! gruvbox#bg_toggle()
|
||||||
|
if &background == 'dark'
|
||||||
|
set background=light
|
||||||
|
else
|
||||||
|
set background=dark
|
||||||
|
endif
|
||||||
|
|
||||||
|
colo gruvbox
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! gruvbox#invert_signs_toggle()
|
||||||
|
if g:gruvbox_invert_signs == 0
|
||||||
|
let g:gruvbox_invert_signs=1
|
||||||
|
else
|
||||||
|
let g:gruvbox_invert_signs=0
|
||||||
|
endif
|
||||||
|
|
||||||
|
colo gruvbox
|
||||||
|
endfunction
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
" Description: Retro groove color scheme for Vim
|
" Description: Retro groove color scheme for Vim
|
||||||
" Author: morhetz <morhetz@gmail.com>
|
" Author: morhetz <morhetz@gmail.com>
|
||||||
" Source: https://github.com/morhetz/gruvbox
|
" Source: https://github.com/morhetz/gruvbox
|
||||||
" Last Modified: 12 Dec 2013
|
" Last Modified: 16 Dec 2013
|
||||||
" -----------------------------------------------------------------------------
|
" -----------------------------------------------------------------------------
|
||||||
|
|
||||||
" Supporting code -------------------------------------------------------------
|
" Supporting code -------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user