aboutsummaryrefslogtreecommitdiff
path: root/vim/config/syntax.vim
Commit message (Collapse)AuthorAgeFilesLines
* Junk detect_background.vim and thereby autoloadTom Ryder2018-05-311-10/+5
| | | | | | | | | | | 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.
* Remove Pathogen from Vim setupTom Ryder2018-01-231-0/+5
| | | | | | | Given that all of this is installed rather than symbolically linked, there's not really any harm following the old mixed ~/.vim layout for plugins. It's one less dependency and it makes the setup quite a bit less complicated.
* Make entire syntax config dependent on load stateTom Ryder2018-01-201-5/+3
|
* Activate syntax settings conditionallyTom Ryder2018-01-201-2/+4
| | | | | | | | | Per an oft-made recommendation on /r/vim .vimrc review threads: <https://www.reddit.com/r/vim/comments/6znskl/vimrc_review_thread/dnbmvxv/> > Re-sourcing the vimrc won't clobber any of your personal highlight > settings and the if part helps avoid unneeded re-execution/reprocessing.
* Remove redundant has('eval') VimL testTom Ryder2017-11-061-1/+1
| | | | | | | | From what I understand from ":help if", ancient Vim and/or vim-tiny without the 'eval' feature will simply gloss over all commands between :if and :endif without executing them. Therefore as soon as we test a version, we're implicitly excluding everything that doesn't have 'eval' anyway.
* Make background detection return not set valueTom Ryder2017-11-061-2/+4
| | | | This approach allows more flexibility from the caller's side.
* Wrap detect_background.vim func call in 'silent!'Tom Ryder2017-11-041-1/+1
| | | | | | This prevents older versions of Vim like 6.2 from throwing "E1017: Missing braces" on merely parsing this code, even though they don't evaluate it.
* Move Vim background detection logic into pluginTom Ryder2017-11-041-25/+2
|
* Apply name conventions, scoping to Vim identifiersTom Ryder2017-10-301-2/+2
| | | | | | | | | | | | | | | | | | The Google VimScript Style Guide says <https://google.github.io/styleguide/vimscriptguide.xml#Naming>: >In general, use plugin-names-like-this, FunctionNamesLikeThis, >CommandNamesLikeThis, augroup_names_like_this, >variable_names_like_this. Adjusted variable, function, and `augroup` names accordingly, including setting script scope for some of the functions and their calls (`s:` and `<SID>` prefixes). Initially I tried using `prefix#`, but it turns out that this is a namespacing contention for publically callable functions like `pathogen#infect`, and none of these functions need to be publically callable.
* Use ==# consistently in Vim configTom Ryder2017-10-301-1/+1
| | | | | | | | | | | | I got a set of warnings from vim-vint about using just "==" for these comparisons: >Use robust operators `==#` or `==?` instead of `==` (see Google >VimScript Style Guide (Matching)) It does seem a lot more sensible to be explicit about case sensitivity, and not to lean on the configured 'ignorecase' value, especially if the user changes it.
* Correct comment typoTom Ryder2017-10-301-1/+1
|
* Require minimum Vim version for background detectTom Ryder2017-10-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | On an ancient Vim (6.1), the block of code checking the value of COLORFGBG does not work at all, raising the following error output: Error detected while processing function DetectBackground: line 3: E117: Unknown function: split E15: Invalid expression: split($COLORFGBG, ';') line 6: E121: Undefined variable: l:colorfgbg E15: Invalid expression: len(l:colorfgbg) ? l:colorfgbg[-1] : '' line 9: E121: Undefined variable: l:bg E15: Invalid expression: l:bg == 'default' || l:bg == '7' || l:bg == '15' line 11: :else without :if: else line 13: :endif without :if: endif I'm unlikely to need such an ancient Vim very often, so I've simply added an error guard around the block.
* Switch on COLORFGBG to get background lightnessTom Ryder2017-10-291-3/+26
| | | | | | | | | | | | | | Now that this environment variable is kept and updated in tmux after 54553ae, we should be able to either configure terminals or explicitly set it during startup if we want to use lighter terminals. I'm much more comfortable with this than simply hardcoding it in the configuration. This doesn't solve the problem of carrying the environment variable over an SSH session, however, but I'm not really sure there's a solution to that besides configuring sshd(8) itself to accept these variables in transit.
* Restore 'background' .vimrc settingTom Ryder2017-10-281-0/+4
| | | | | | Per 6ca11a5, I've confirmed I do still need this, otherwise the default colorschemes (not sahara.vim) assume a bright background and show very dark colours.
* Move syntax .vimrc config into subfileTom Ryder2017-10-281-0/+8
| | | | | | | | | Some refactoring is done here, because as noted in 5caa13c, my custom colorscheme is implemented as a plugin to be loaded by Pathogen, and hence isn't available into after it's done its work. I've removed the :set background line for now until I'm sure it's needed, because at the moment I'm not sure.
* Move syntax config back into .vimrcTom Ryder2017-10-281-12/+0
| | | | | | | | | | This reverts commit 5dba4c. The order of the configuration matters more for these settings, because the "sahara" colorscheme is only available after loading it as a plugin. I'll divest some other stuff that should be less sensitive to the order in which it's loaded first, and then tackle this one afterwards.
* Move syntax highlight .vimrc config into subfileTom Ryder2017-10-281-0/+12
This appears to break my choice of syntax colorscheme; the order of loading some of the previous directives in the configuration may have been relevant.