aboutsummaryrefslogtreecommitdiff
path: root/vim/indent
Commit message (Collapse)AuthorAgeFilesLines
* Use consistent/thorough ftplugin/indent unloadingTom Ryder2017-11-083-6/+8
| | | | Unload all maps too, with silent! in case they don't exist.
* Add user_ftplugin.vim and user_indent.vim pluginsTom Ryder2017-11-073-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 09b83b6 and replaces it with a working version. Because of the order in which the autocmd hooks run, the attempted method of adding unloading instructions for my custom ftplugin and indent rules to the b:undo_ftplugin and b:undo_indent doesn't actually work. This is because the custom rules for both groups from ~/.vim are sourced *first*, before their core versions, so the changes the custom rules made to b:undo_ftplugin and b:undo_indent are simply clobbered by the core version when it loads itself. Therefore we need to arrange for two things: 1. A custom variable needs to be checked and executed when the filetype changes to revert the changes for the custom ftplugin or indent rules. 2. That execution needs to take place *first* when the filetype changes. I wrote two simple plugins with very similar code that are designed to run as a user's custom ftplugin.vim and indent.vim implementations, running before their brethren in the Vim core, and setting up an autocmd hook to :execute b:undo_user_ftplugin and b:undo_user_indent plugin respectively. This seemed to work well, so I've implemented it. It involves adding a shim to ~/.vim/indent.vim and ~/.vim/ftplugin.vim to "preload" the plugin when the `filetype indent plugin on` call is made. I've added that to the relevant Makefile targets.
* Use b:undo variables correctlyTom Ryder2017-11-079-32/+21
| | | | | | | | | | | Setting or adding to b:undo_indent and b:undo_ftplugin variables, which I only learned about just now, allows me to avoid the _GLOBAL.vim hack and remove some files from both vim/indent/ and vim/ftplugin/. These variables aren't subjected to :execute automatically in anything older than Vim 7.0, but I don't think that's too much of a concern as the only real reason they're needed are for changing filetypes in the same buffer, which doesn't happen that often anyway.
* Use spaces around concat dots in VimL consistentlyTom Ryder2017-11-041-3/+3
|
* Reload indent global defaults before each filetypeTom Ryder2017-10-313-0/+9
| | | | | | Just to be comprehensive, reinstate the global defaults for all the indenting options via the indent/_GLOBAL.vim stub each time the filetype is changed.
* Use clunkier, more compatible indent option resetTom Ryder2017-10-311-6/+5
| | | | | | This method of re-setting the numeric indent local options to their global analogues looks a bit gross, but seems to work on much older versions of Vim (6.2 in this testing).
* Move non-indent HTML Vim config indent->ftpluginTom Ryder2017-10-301-12/+0
| | | | | This was mistakenly moved along with some indentation settings in 9858af6.
* Use correct syntax for numeric indent resetsTom Ryder2017-10-301-3/+3
| | | | | | These trailing equals signs were vestigial from an attempt in f33111b to use what I thought was a backwards-compatible syntax for resetting a local option to its global state.
* Use version guard around numeric indent resetsTom Ryder2017-10-301-3/+8
| | | | | | | | | | | | | | My old 6.2 version of Vim tolerates neither `option<` nor `option=` syntax for resetting local versions of these options, so I'm just going to have to guard against running those commands on ancient Vim for now. They seem to work correctly on 7.0. :setlocal shiftwidth< Number required after =: shiftwidth< :setlocal shiftwidth= Number required after =: shiftwidth= :setlocal shiftwidth=0 Argument must be positive: shiftwidth=0
* Use backward-compat syntax for reset indent optsTom Ryder2017-10-301-3/+3
| | | | | | | For compatibility with older versions of Vim, string-based (not boolean) options need to be reset with `setlocal option=`, rather than `<`. New versions of Vim tolerate the latter for the string values, and do what you meant.
* Add autoindent and expandtab to indent _GLOBALTom Ryder2017-10-301-0/+2
| | | | | | This will mean the correct value is restored for filetypes that source this file as part of their indent processing, and won't stay broken if we switched from e.g. CSV or TSV.
* Use a common file to restore global indent optsTom Ryder2017-10-306-31/+17
| | | | | | Remove the duplicated code instated to use the global defaults for indent-related options and put it into a common file to source with :runtime.
* Move filetype-specific indent options into indent/Tom Ryder2017-10-308-0/+53
| | | | | | I'm still getting used to the structure of the configuration here, and had mistakenly put these indent-related settings into files in the ftplugin directory.
* Move PHP indent nixing into ~/.vim/indentTom Ryder2017-10-301-0/+4
This method short-circuits the unwanted PHP expression-based indenting configuration completely, rather than running it all and then undoing it after the fact. This involves creating a new direction ~/.vim/indent, and a Makefile target install-vim-indent to copy everything into it.