| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Unload all maps too, with silent! in case they don't exist.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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).
|
|
|
|
|
| |
This was mistakenly moved along with some indentation settings in
9858af6.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
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.
|