aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/detect_background.vim
Commit message (Collapse)AuthorAgeFilesLines
* Junk detect_background.vim and thereby autoloadTom Ryder2018-05-311-37/+0
| | | | | | | | | | | It's too complicated and confusing, and doesn't do enough to justify wrecking Vim's own logic for doing this sort of thing. Better to just say `:set background=dark` and be done with it. This is the only one of my inline plugins with an `autoload` file, so we can get rid of that, too. Not worth packaging/publishing to www.vim.org.
* Join short-circuit line in detect_background.vimTom Ryder2018-01-211-2/+1
| | | | | This makes the block work correctly when 'compatible' is set and 'C' is in 'cpoptions'.
* Don't use VimL ==# for number comparisonsTom Ryder2017-11-061-2/+2
| | | | | | | | | | | The Google VimScript Guide says: <https://google.github.io/styleguide/vimscriptfull.xml#Portability> > Always use case-explicit operators for strings (=~# and =~?, never =~). > > This also applies to !~ == != > >= < and <= > This only applies for strings. == and >= are fine for numbers, but ==# > and >=# must be used for strings.
* Make background detection return not set valueTom Ryder2017-11-061-2/+5
| | | | This approach allows more flexibility from the caller's side.
* Add 'abort' attribute to autoload functionTom Ryder2017-11-051-1/+1
| | | | | | | | | `vint -s` says: > vim/autoload/detect_background.vim:16:1: Use the abort attribute for > functions in autoload (see Google VimScript Style Guide (Functions)) All right, then. Doesn't seem to break vim.tiny or Vim 6.1.
* Add short-circuit boilerplate to pluginsTom Ryder2017-11-041-0/+7
| | | | | | | | | | | | | | | | | | | | Set a g:loaded_* flag to prevent repeated reloads, and refuse to load at all if &compatible is set or if required features are missing. Some more accommodating plugins avoid the problems 'compatible' causes by saving its value at startup into a script variable, setting the option to the Vim default, and then restoring it when the plugin is done, to prevent any of its flags from interfering in the plugin code: let s:save_cpo = &cpo set cpo&vim ... let &cpo = s:save_cpo unlet s:save_cpo I don't want this boilerplate, so I'm going to do what Tim Pope's modules seem to, and just have the plugin refuse to do a single thing if 'compatible' is set.
* Adjust plugin code layout a lotTom Ryder2017-11-041-2/+6
| | | | | | | | | | | | | Including renaming big_file.vim and accompanying functions yet again, to big_file_options.vim. Trying to keep complex autocmd and mapping definitions on long lines broken up semantically; definition and options on one line, patterns or mapping key on the next, and the command to run on the last. Also trying to make sure that <silent>, <buffer>, and <unique> are applied in the correct places, and that all mapping commands are using the :<C-U> idiom for the command prefix.
* Use same comment boilerplate for custom pluginsTom Ryder2017-11-041-2/+8
| | | | A brief explanation, an author name, and the license should do fine.
* Move Vim background detection logic into pluginTom Ryder2017-11-041-0/+18