aboutsummaryrefslogtreecommitdiff
path: root/vim/indent
Commit message (Collapse)AuthorAgeFilesLines
* Clean up Vim indent settings a bitTom Ryder2019-06-222-5/+10
|
* Move Vim help indent rules to main indent ftpluginTom Ryder2019-06-201-0/+12
| | | | | I assumed Vim's runtime files included indent rules for :help files, but they don't.
* Spruce up CSV and TSV Vim filetype scriptsTom Ryder2019-06-142-13/+8
|
* Add explanatory comment on Vim indent ftpluginTom Ryder2019-06-141-0/+3
|
* Remove unneeded password filetypeTom Ryder2019-06-141-11/+0
|
* Remove unnecessary g: prefixes to Vim variablesTom Ryder2019-05-091-1/+1
|
* Tweak HTML indenting to indent after <p>Tom Ryder2018-07-091-0/+2
|
* Remove Perl indent string againTom Ryder2018-07-081-137/+0
| | | | This is probably fighting too much against the grain, at least for now.
* Simplify in/out indent for blocksTom Ryder2018-07-071-16/+22
|
* Require semicolon on same line of heredocTom Ryder2018-07-071-0/+1
|
* Inline ternary condition in Perl Vim indentTom Ryder2018-07-071-3/+1
|
* More speed refactoring for Perl Vim indentTom Ryder2018-07-071-23/+18
|
* Rearrange heredoc/POD indent check for speedTom Ryder2018-07-071-9/+10
|
* Refine Perl line cont hints in Vim indentTom Ryder2018-07-071-4/+4
|
* Simplify Vim Perl shiftwidth calculationTom Ryder2018-07-071-4/+3
| | | | This is a portable method that will work on very old Vims.
* Simplify POD Vim indenting behaviourTom Ryder2018-07-071-6/+6
|
* Add POD rules to Vim Perl indentTom Ryder2018-07-071-18/+34
|
* Pass Vim indent line into Perl functionTom Ryder2018-07-071-4/+4
| | | | Should make testing (!) easier later on.
* Further extension of Perl Vim line cont rulesTom Ryder2018-07-071-8/+15
|
* Remove misplaced separator in b:undo_indentTom Ryder2018-07-071-1/+1
| | | | | This was causing the first line of the buffer to be printed on every filetype change from Perl.
* Revert "Remove Vim Perl indent"Tom Ryder2018-07-071-0/+114
| | | | | | This reverts commit f0b98feb769d9dfbbb0c1825b1291851795163db. I changed my mind again.
* Remove Vim Perl indentTom Ryder2018-07-071-114/+0
| | | | | This one is pretty good, but I think I'll stick with the stock one for now.
* Committing final state of Vim Perl indentTom Ryder2018-07-071-12/+16
| | | | | I'm not sure I actually want to use this anymore; will remove it for now in the next commit.
* Correct end of heredoc pattern in Vim Perl indentTom Ryder2018-07-071-1/+1
| | | | Just a plain old syntax error.
* Adjust continued line indent for Vim PerlTom Ryder2018-07-071-1/+1
| | | | | Don't add another two spaces if we already did on a previous line; get the "base" indent first.
* Add heredoc support to Vim Perl indent pluginTom Ryder2018-07-071-2/+51
| | | | | This anchors lines in a Perl heredoc with no indent until it sees the terminating word. It works really well.
* Refactor rules in Vim Perl indent scriptTom Ryder2018-07-071-18/+6
| | | | | I think this is mixing two changes I made, which I neglected to commit separately.
* Remove unneeded parens in Vim Perl indent scriptTom Ryder2018-07-071-1/+1
| | | | | The modulo operator has a higher precedence than the subtraction operator, so it doesn't need to be cuddled.
* Rearrange settings in Vim Perl indent scriptTom Ryder2018-07-071-4/+4
| | | | | | The version of this indent script bundled with Vim sets the 'indentexpr' and 'indentkeys' options before the GetPerlIndent() function; may as well follow that pattern.
* Adjust a few Vim Perl indent commentsTom Ryder2018-07-071-5/+5
|
* Get 'shiftwidth' in Vim Perl indent portablyTom Ryder2018-07-071-1/+3
| | | | | | | | | | | From `:help shiftwidth()`: > Returns the effective value of 'shiftwidth'. This is the 'shiftwidth' > value unless it is zero, in which case it is the 'tabstop' value. This > function was introduced with patch 7.3.694 in 2012, everybody should > have it by now. I'd like my stuff to work on older versions, though, and it's not hard to make it work.
* Adjust leading comment for Vim Perl indentTom Ryder2018-07-071-5/+1
|
* Refactor opening of Vim Perl indent scriptTom Ryder2018-07-061-6/+5
|
* Add a comment to Vim Perl indent rulesTom Ryder2018-07-061-0/+2
|
* Add attempt at own Vim Perl indentingTom Ryder2018-07-061-0/+74
|
* Remove vim/indent/php.vim blocker stubTom Ryder2018-06-301-10/+0
| | | | Let's give this another try, and maybe configure it this time.
* Review vim/ftplugin and vim/indent filesTom Ryder2018-06-302-4/+4
|
* Add password filetypeTom Ryder2018-06-231-0/+11
|
* Turn off Vim 'softtabstop' for CSV and TSV filesTom Ryder2018-02-172-2/+4
| | | | | Otherwise entering a Tab in insert mode inserts four spaces. I'm not sure how I didn't notice this before.
* Adjust explanation of PHP indent skipTom Ryder2018-02-011-3/+9
| | | | Include the variable guard, just for completeness' sake.
* Break some continued lines in Vim indent filesTom Ryder2018-01-212-4/+2
| | | | | This will mean they load correctly when the 'C' flag preventing line-breaking is in 'cpoptions', and 'compatible' is set.
* Move lots of local Vim config into vim/afterTom Ryder2017-11-123-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a relatively drastic change that should have been done progressively, but I got carried away in ripping everything out and putting it back in again. Reading the documentation for writing a Vim script (:help usr_41.txt), I am convinced that all of the content that was in the vim/ftplugin directory and some of the vim/indent directory actually belonged in vim/after/ftplugin and vim/after/indent respectively. This is because the section on filetypes makes the distinction between replacing the core filetype or indent plugins and merely adding to or editing them after the fact; from :help ftplugin: > If you do want to use the default plugin, but overrule one of the > settings, you can write the different setting in a script: > > setlocal textwidth=70 > > Now write this in the "after" directory, so that it gets sourced after > the distributed "vim.vim" ftplugin after-directory. For Unix this > would be "~/.vim/after/ftplugin/vim.vim". Note that the default > plugin will have set "b:did_ftplugin", but it is ignored here. Therefore, I have deleted the user_indent.vim and user_ftplugin.vim plugins and their documentation that I wrote, and their ftplugin.vim and indent.vim shims in ~/.vim, in an attempt to make these plugins elegantly undo-ready, and instead embraced the way the documentation and $VIMRUNTIME structure seems to suggest. I broke the ftplugin files up by function and put them under subdirectories of vim/after named by filetype, as the 'runtimepath' layout permits. In doing so, I also carefully applied the documentation's advice: * Short-circuiting repeated loads * Checking for existing mappings using the <Plug> prefix approach * Avoiding repeated function declarations overwriting each other * Guarding against 'cpotions' mangling things (by simply short-circuiting if 'compatible' is set). I've made the b:undo_ftplugin and b:undo_indent commands less forgiving, and append commands to it inline with the initial establishment of the setup they're reversing, including checking that the b:undo_* variable actually exists in the first place. For the indentation scripts, however, three of the four files originally in vim/indent actually do belong there: 1. csv.vim, because it doesn't have an indent file in the core. 2. tsv.vim, because it doesn't have an indent file in the core. 3. php.vim, because it does what ftplugins are allowed to do in preventing the core indent rules from running at all. The indent/vim.vim rules, however, have been moved to after/indent/vim.vim, because the tweaks it makes for two-space indentation are designed to supplement the core indent rules, not replace them. Finally, I've adjusted Makefile targets accordingly for the above, given the vim/ftplugin directory is now empty and there are three new directories in vim/after to install. We wrap these under a single `install-vim-after` parent target for convenience. The `install-vim-after-ftplugin` target accommodates the additional level of filetype directories beneath it.
* 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.