aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin
AgeCommit message (Collapse)AuthorFilesLines
2018-07-16Reformat comment in wildignore.vimTom Ryder1-3/+3
2018-07-16Add shebang_create_exec.vim pluginTom Ryder1-0/+35
2018-07-15Add plugin file for setting 'wildignore'Tom Ryder1-0/+170
2018-07-14Spin off vimrc_reload_filetype.vimTom Ryder1-23/+0
2018-07-13Rename and refine reload_vimrc_filetype.vimTom Ryder1-10/+5
2018-07-13Move .vimrc reloading stuff into custom pluginTom Ryder1-0/+28
Not sure whether I'll bother packaging this one.
2018-07-10Remove session_lazy.vimTom Ryder1-23/+0
I think this is the wrong approach, and maybe even a slight security risk.
2018-07-10Add session_lazy.vim pluginTom Ryder1-0/+23
Mostly to properly tie down the way I want sessions to behave while I write my book. No documentation yet!
2018-07-09Don't defer package load for matchitTom Ryder1-1/+1
2018-07-08Move shebang updating into filetype.vimTom Ryder1-20/+0
Much more logical location.
2018-07-08Correct a comment on shebang_update.vimTom Ryder1-1/+1
2018-07-05Add shebang_update.vim pluginTom Ryder1-0/+20
This plugin updates the filetype after every insert operation that changes the first line. No documentation yet.
2018-07-01Move plugin-specific settings into ~/.vim/pluginTom Ryder3-5/+22
Makes way more sense--these files won't get loaded by definition unless plugins are enabled, and dist.vim will still be in time to stop the distributed plugins from loading.
2018-06-02Refactor Vim distribution plugin/macro handlingTom Ryder1-0/+5
Intelligently choose how to load matchit.vim, and clean up the short-circuit variables for the unwanted distribution plugins in an "after" plugin script.
2018-05-31Merge auto_*dir.vim plugins into one, spun outTom Ryder3-174/+0
Functionality merged into new plugin auto_cache_dir.vim.
2018-05-31Spin off command_typos Vim pluginTom Ryder1-45/+0
Renamed as uncap_ex.vim.
2018-05-31Spin off big_file_options Vim pluginTom Ryder1-66/+0
2018-05-31Spin off strip_trailing_whitespace Vim pluginTom Ryder1-75/+0
2018-05-31Spin off mail_mutt Vim pluginTom Ryder1-56/+0
2018-05-31Spin off copy_linebreak Vim pluginTom Ryder1-68/+0
2018-05-30Spin off toggle_option_flag Vim pluginTom Ryder1-104/+0
2018-05-30Spin off fixed_join Vim pluginTom Ryder1-45/+0
2018-05-30Spin off insert_suspend_hlsearch Vim pluginTom Ryder1-47/+0
2018-05-30Tidy comments, func names for 'hlsearch' suspendTom Ryder1-9/+10
2018-05-30Require +extra_search feat for 'hlsearch' suspendTom Ryder1-1/+1
2018-05-30Remove untidy commentTom Ryder1-1/+0
2018-05-30Merge branch 'hotfix/v0.34.1' into developTom Ryder1-1/+0
* hotfix/v0.34.1: Bump VERSION Remove stray echo from Vim plugin
2018-05-30Remove stray echo from Vim pluginTom Ryder1-1/+0
This was probably left in during debugging. Because 'showmode' hides it, it didn't get noticed.
2018-05-28Use _save suffix for option caching variableTom Ryder1-2/+2
This makes it explicit what the variable is for, in the same way as s:cpoptions_save in vim/vimrc.
2018-05-28Use script variable to keep showbreak settingTom Ryder1-2/+3
The 'showbreak' option is global and has no local value--that is, it's not global-local--so `setlocal` actually just changes the global value, and hence we can't "change back" using `setlocal showbreak<`. Instead, keep the "normal" value in a script variable so that we can reliably switch back to it. This surprised me, as I had thought it was working, but I can't find even an older Vim that behaves the way I expected it too. I suppose I must just not have changed back often enough to actually notice.
2018-01-17Refactor directory creation in pluginsTom Ryder3-12/+12
No functional changes here, just removing a little duplicate code.
2017-11-14Correct stray elseif in auto_undodir.vimTom Ryder1-1/+1
This was causing the following error on load: > Error detected while processing /home/tom/.vim/plugin/auto_undodir.vim: > line 48: > E580: :endif without :if: endif
2017-11-13Merge branch 'feature/vim-plug' into developTom Ryder3-18/+24
* feature/vim-plug: Check for shellescape() function before using it
2017-11-13Strip trailing whitespaceTom Ryder4-10/+10
2017-11-13Check for shellescape() function before using itTom Ryder3-18/+24
It was added in patch 111 for Vim 7.0.
2017-11-13Move 'hlsearch' insert-mode suspension into pluginTom Ryder1-0/+48
It's easily repackaged and it makes the configuration that much shorter, so I may as well. This version also correctly handles 'hlsearch' not being on in the first place.
2017-11-12Separate g:loaded/&cp tests from feat testsTom Ryder6-6/+24
Keeping the tests at the beginning of plugins on one line without continuations is needed to work around &cpo-=C.
2017-11-12Remove stray blank line from mail_mutt.vimTom Ryder1-1/+0
2017-11-12Bind norm J on fixed_join.vim load if appropriateTom Ryder1-0/+6
If there are no mappings to the <Plug>FixedJoin target that the fixed_join.vim plugin provides at the time it is loaded, and the line-joining function of normal-mode J is not already mapped, the plugin will try to map it itself, for a more plug-and-play.
2017-11-12Move lots of local Vim config into vim/afterTom Ryder12-80/+10
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.
2017-11-11Add author/license boilerplate to all pluginsTom Ryder2-0/+6
user_ftplugin.vim and user_indent.vim seem to be missing it.
2017-11-11Merge branch 'feature/vim-mutt-plug' into developTom Ryder1-0/+56
* feature/vim-mutt-plug: Move mutt_mail.vim line select logic into plugin Add new mail_mutt.vim plugin, apply mappings Beginnings of a buffer-to-Mutt mailer plugin
2017-11-11Move mutt_mail.vim line select logic into pluginTom Ryder1-0/+15
This makes the configuration shorter and easier to read.
2017-11-11Add new mail_mutt.vim plugin, apply mappingsTom Ryder1-0/+41
This plugin provides a shortcut for staring email messages in Mutt with a range of lines.
2017-11-10Use exists+ test rather than exists&Tom Ryder2-3/+3
From :help hidden-options: >Not all options are supported in all versions. This depends on the >supported features and sometimes on the system. A remark about this is >in curly braces below. When an option is not supported it may still be >set without getting an error, this is called a hidden option. You can't >get the value of a hidden option though, it is not stored. > >To test if option "foo" can be used with ":set" use something like this: > if exists('&foo') >This also returns true for a hidden option. To test if option "foo" is >really supported use something like this: > if exists('+foo')
2017-11-10Move backup, swap, and undo dir logic into pluginsTom Ryder3-0/+169
2017-11-07Add user_ftplugin.vim and user_indent.vim pluginsTom Ryder2-0/+48
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.
2017-11-07Add commands to copy_linebreak.vimTom Ryder1-1/+14
Just to be thorough; if +user_commands are available, offer :CopyLinebreakEnable, :CopyLinebreakDisable, and :CopyLinebreakToggle commands.
2017-11-07Give copy_linebreak.vim enable/disable funcs, mapsTom Ryder1-22/+34
Add s:CopylinebreakDisable() and s:CopylinebreakEnable functions, and mapping targets for each of them, just to be thorough.
2017-11-07Add :FixedJoin commandTom Ryder1-2/+9
This is optiona; if the user's Vim doesn't have the 'user_commands' feature, the command will just quietly not be created.