Browse Source

Additional functions

morhetz 12 years ago
parent
commit
e475aea6d7
3 changed files with 54 additions and 11 deletions
  1. 26 10
      README.md
  2. 27 0
      autoload/gruvbox.vim
  3. 1 1
      colors/gruvbox.vim

+ 26 - 10
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 <F5> :call ToggleBg()<CR>
-	function! ToggleBg()
-		if &background == 'dark'
-			set bg=light
-		else
-			set bg=dark
-		endif
-
-		colo gruvbox
-	endfunc
+	map <silent> <F5> :call gruvbox#bg_toggle()<CR>
+	imap <silent> <F5> <ESC>:call gruvbox#bg_toggle()<CR>a
+	vmap <silent> <F5> <ESC>:call gruvbox#bg_toggle()<CR>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
 -------------
 

+ 27 - 0
autoload/gruvbox.vim

@@ -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

+ 1 - 1
colors/gruvbox.vim

@@ -3,7 +3,7 @@
 " Description: Retro groove color scheme for Vim
 " Author: morhetz <morhetz@gmail.com>
 " Source: https://github.com/morhetz/gruvbox
-" Last Modified: 12 Dec 2013
+" Last Modified: 16 Dec 2013
 " -----------------------------------------------------------------------------
 
 " Supporting code -------------------------------------------------------------