From e475aea6d71092a40e08a08e380d5602a3ab52f0 Mon Sep 17 00:00:00 2001 From: morhetz Date: Tue, 17 Dec 2013 00:13:28 +0400 Subject: [PATCH] Additional functions --- README.md | 36 ++++++++++++++++++++++++++---------- autoload/gruvbox.vim | 27 +++++++++++++++++++++++++++ colors/gruvbox.vim | 2 +- 3 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 autoload/gruvbox.vim diff --git a/README.md b/README.md index 44e4edba..5996f924 100644 --- a/README.md +++ b/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: - map :call ToggleBg() - function! ToggleBg() - if &background == 'dark' - set bg=light - else - set bg=dark - endif - - colo gruvbox - endfunc + map :call gruvbox#bg_toggle() + imap :call gruvbox#bg_toggle()a + vmap :call gruvbox#bg_toggle()gv 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. default: `0` +Functions +--------- + +### gruvbox#bg_toggle() + +(...) + +### gruvbox#invert_signs_toggle() + +(...) + +### gruvbox#hls_show() + +(...) + +### gruvbox#hls_hide() + +(...) + +### gruvbox#hls_toggle() + +(...) + Contributions ------------- diff --git a/autoload/gruvbox.vim b/autoload/gruvbox.vim new file mode 100644 index 00000000..dbc73a0d --- /dev/null +++ b/autoload/gruvbox.vim @@ -0,0 +1,27 @@ +" ----------------------------------------------------------------------------- +" File: gruvbox.vim +" Description: Retro groove color scheme for Vim +" Author: morhetz +" 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 diff --git a/colors/gruvbox.vim b/colors/gruvbox.vim index ebc5f2ce..d9b56805 100644 --- a/colors/gruvbox.vim +++ b/colors/gruvbox.vim @@ -3,7 +3,7 @@ " Description: Retro groove color scheme for Vim " Author: morhetz " Source: https://github.com/morhetz/gruvbox -" Last Modified: 12 Dec 2013 +" Last Modified: 16 Dec 2013 " ----------------------------------------------------------------------------- " Supporting code -------------------------------------------------------------