diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-04 18:48:22 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-04 18:48:22 +1300 |
commit | 63087e57b8b1aa030b431b86f3be533ee20f07dc (patch) | |
tree | d9c129817e6e9722bdd8c559dc2f341991b68040 /vim/config/syntax.vim | |
parent | Merge branch 'hotfix/v0.6.1' (diff) | |
parent | Update dotfiles(7) manual from README.md (diff) | |
download | dotfiles-a24ca4fd5b9d7d954475a311d9ae402949884286.tar.gz (sig) dotfiles-a24ca4fd5b9d7d954475a311d9ae402949884286.zip |
Merge branch 'release/v0.7.0'v0.7.0
* release/v0.7.0: (21 commits)
Update dotfiles(7) manual from README.md
Bump version number
Add heading for Vim plugins subsection
Update README to mention Vim plugins
Rename toggle plugin again, use commands not funcs
Add short documentation for new custom plugins
Use same comment boilerplate for custom plugins
Check 'eval' feature for loading command_typos.vim
Wrap detect_background.vim func call in 'silent!'
Rename and refactor option toggle plugin
Don't suggest mappings in Vim plugin comments
Move Vim background detection logic into plugin
Specify an install-vim-autoload target
Spin 'fo' toggle out into new flag toggler plugin
Spin copyable linebreak config into new plugin
Spin stable join config out into new plugin
Use <Plug> prefix, make space strip configurable
Rename a misnamed variable in big_file.vim
Rename bigfile plugin to big_file
Move trailing space strip config into plugin
...
Diffstat (limited to 'vim/config/syntax.vim')
-rw-r--r-- | vim/config/syntax.vim | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/vim/config/syntax.vim b/vim/config/syntax.vim index e7d94b1b..8cb1228b 100644 --- a/vim/config/syntax.vim +++ b/vim/config/syntax.vim @@ -5,32 +5,9 @@ if has('syntax') silent! syntax enable silent! syntax sync minlines=100 - " Invert Vim's built-in logic for choosing dark or light backgrounds; we'll - " default to choosing a dark background unless we find some reason *not* to. + " If we can, detect a light background, but default to a dark one if has('eval') && v:version >= 701 - - " Wrap all this logic in a function - function! s:DetectBackground() - - " Split up the value of $COLORFGBG (if any) by semicolons - let l:colorfgbg = split($COLORFGBG, ';') - - " Get the background color value, or an empty string if none - let l:bg = len(l:colorfgbg) ? l:colorfgbg[-1] : '' - - " Choose the background setting based on this value - if l:bg ==# 'default' || l:bg ==# '7' || l:bg ==# '15' - set background=light - else - set background=dark - endif - - endfunction - - " Call the function just defined directly - call s:DetectBackground() - - " Ancient or cut-down Vim? Just go dark + silent! call detect_background#DetectBackground() else set background=dark endif |