Cleanup and small fixes

This commit is contained in:
morhetz
2013-12-12 23:11:39 +04:00
parent 3b5730abe0
commit 9a5cd1b407
2 changed files with 12 additions and 20 deletions

View File

@@ -60,7 +60,7 @@ Just setting background to an appropriate value would work as well:
set bg=dark " Setting dark mode set bg=dark " Setting dark mode
set bg=light " Setting light mode set bg=light " Setting light mode
Since gruvbox inverts cursor color, when the search is highlighted, it could be awkward to determine current position. To get single cursor color while searching map gruvbox functions same way: 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 same way:
map <silent> <F4> :call gruvbox#hls_toggle()<CR> map <silent> <F4> :call gruvbox#hls_toggle()<CR>
imap <silent> <F4> <ESC>:call gruvbox#hls_toggle()<CR>a imap <silent> <F4> <ESC>:call gruvbox#hls_toggle()<CR>a
@@ -124,7 +124,7 @@ Enables undercurled text.
default: `1` default: `1`
### g:gruvbox_termcolors ### g:gruvbox_termcolors
Uses 256-color palette (suitable to pair with gruvbox-palette shell script). If you're dissatisfied with that set option value to `16` to fallback base colors to your terminal palette. Refer [†][14] for details. Uses 256-color palette (suitable to pair with gruvbox-palette shell script). If you're dissatisfied with that, set option value to `16` to fallback base colors to your terminal palette. Refer [†][14] for details.
default: `256` default: `256`
[14]: https://github.com/morhetz/gruvbox/issues/4 [14]: https://github.com/morhetz/gruvbox/issues/4

View File

@@ -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: 11 Oct 2013 " Last Modified: 9 Dec 2013
" ----------------------------------------------------------------------------- " -----------------------------------------------------------------------------
" Supporting code ------------------------------------------------------------- " Supporting code -------------------------------------------------------------
@@ -69,18 +69,14 @@ if !exists('g:gruvbox_invert_selection')
let g:gruvbox_invert_selection=1 let g:gruvbox_invert_selection=1
endif endif
if &background == 'light' let s:is_dark=(&background == 'dark')
let s:gruvbox_background='light'
else
let s:gruvbox_background='dark'
endif
" }}} " }}}
" Palette: {{{ " Palette: {{{
let s:gb = {} let s:gb = {}
if &background == 'dark' if s:is_dark
let s:gb.dark0 = ['282828', 235] " 40-40-40 let s:gb.dark0 = ['282828', 235] " 40-40-40
let s:gb.dark1 = ['3c3836', 237] " 60-56-54 let s:gb.dark1 = ['3c3836', 237] " 60-56-54
let s:gb.dark2 = ['504945', 239] " 80-73-69 let s:gb.dark2 = ['504945', 239] " 80-73-69
@@ -245,10 +241,10 @@ call s:HL('Normal', 'light1', 'dark0')
" Correct background (see issue #7): " Correct background (see issue #7):
" --- Problem with changing between dark and light on 256 color terminal " --- Problem with changing between dark and light on 256 color terminal
" --- https://github.com/morhetz/gruvbox/issues/7 " --- https://github.com/morhetz/gruvbox/issues/7
if s:gruvbox_background == 'light' if s:is_dark
set background=light
else
set background=dark set background=dark
else
set background=light
endif endif
if version >= 700 if version >= 700
@@ -515,10 +511,12 @@ if g:gruvbox_invert_signs == 0
call s:HL('GitGutterAdd', 'green', g:gruvbox_sign_column) call s:HL('GitGutterAdd', 'green', g:gruvbox_sign_column)
call s:HL('GitGutterChange', 'aqua', g:gruvbox_sign_column) call s:HL('GitGutterChange', 'aqua', g:gruvbox_sign_column)
call s:HL('GitGutterDelete', 'red', g:gruvbox_sign_column) call s:HL('GitGutterDelete', 'red', g:gruvbox_sign_column)
call s:HL('GitGutterChangeDelete', 'aqua', g:gruvbox_sign_column)
else else
call s:HL('GitGutterAdd', 'green', g:gruvbox_sign_column, 'inverse') call s:HL('GitGutterAdd', 'green', g:gruvbox_sign_column, 'inverse')
call s:HL('GitGutterChange', 'aqua', g:gruvbox_sign_column, 'inverse') call s:HL('GitGutterChange', 'aqua', g:gruvbox_sign_column, 'inverse')
call s:HL('GitGutterDelete', 'red', g:gruvbox_sign_column, 'inverse') call s:HL('GitGutterDelete', 'red', g:gruvbox_sign_column, 'inverse')
call s:HL('GitGutterChangeDelete', 'aqua', g:gruvbox_sign_column, 'inverse')
endif endif
@@ -603,6 +601,7 @@ endif
" }}} " }}}
" Clojure: {{{ " Clojure: {{{
call s:HL('clojureKeyword', 'blue') call s:HL('clojureKeyword', 'blue')
call s:HL('clojureCond', 'orange') call s:HL('clojureCond', 'orange')
call s:HL('clojureSpecial', 'orange') call s:HL('clojureSpecial', 'orange')
@@ -629,19 +628,12 @@ call s:HL('clojureMeta', 'yellow')
call s:HL('clojureDeref', 'yellow') call s:HL('clojureDeref', 'yellow')
call s:HL('clojureQuote', 'yellow') call s:HL('clojureQuote', 'yellow')
call s:HL('clojureUnquote', 'yellow') call s:HL('clojureUnquote', 'yellow')
" }}} " }}}
" Functions ------------------------------------------------------------------- " Functions -------------------------------------------------------------------
" Search Highlighting {{{ " Search Highlighting {{{
"function! gruvbox#bg_toggle()
" if &background == 'dark'
" set bg=light
" else
" set bg=dark
" endif
"endfunction
function! gruvbox#hls_show() function! gruvbox#hls_show()
set hlsearch set hlsearch
call s:HL('Cursor', 'dark0', g:gruvbox_hls_cursor) call s:HL('Cursor', 'dark0', g:gruvbox_hls_cursor)