aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-13 00:16:55 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-13 00:16:55 +1300
commit0a717e403db652ca602603617642d8bc7de7e9bb (patch)
treee2be9751fd22fe7cc3f19f44c48d20531fe66cdd
parentd4cbf3994178061dad4a4e2d345f8cf0466bec39 (diff)
parent99d40d4d31f85ce4b34fec5a6e7964e6335d6b8c (diff)
downloaddotfiles-0.15.0.tar.gz
Merge branch 'release/v0.15.0'v0.15.0
* release/v0.15.0: (24 commits) Bump version number to 0.15.0 Limit \f mapping to normal mode Move 'hlsearch' insert-mode suspension into plugin Separate g:loaded/&cp tests from feat tests Use :set not :setlocal for 'hlsearch'/'incsearch' Correct nonexistent 'wildmode' value in Vim config Document each 'backspace' flag in Vim config Mention req of toggle_option_flag.vim Adjust first sentence of format_option_toggle.txt Add help links to toggle_option_flag.vim interface Flesh out strip_trailing_whitespace.vim help Specify type of example in mail_mutt.vim doc Adjust layout of headings/links in Vim plugin help Flesh out fixed_join.vim interface documentation Add help tag for detect_background.vim function Flesh out copy_linebreak.vim interface docs Remove nonexistent keyword references from Vim doc Move Vim doc requirement to correct section Apply boilerplate to Vim plugin docs Update and correct detect_background.vim help ...
-rw-r--r--VERSION4
-rw-r--r--vim/config/backspace.vim11
-rw-r--r--vim/config/completion.vim2
-rw-r--r--vim/config/format.vim2
-rw-r--r--vim/config/search.vim18
-rw-r--r--vim/config/whitespace.vim7
-rw-r--r--vim/doc/auto_backupdir.txt26
-rw-r--r--vim/doc/auto_swapdir.txt30
-rw-r--r--vim/doc/auto_undodir.txt31
-rw-r--r--vim/doc/big_file_options.txt26
-rw-r--r--vim/doc/command_typos.txt26
-rw-r--r--vim/doc/copy_linebreak.txt57
-rw-r--r--vim/doc/detect_background.txt41
-rw-r--r--vim/doc/fixed_join.txt56
-rw-r--r--vim/doc/insert_suspend_hlsearch.txt28
-rw-r--r--vim/doc/mail_mutt.txt71
-rw-r--r--vim/doc/strip_trailing_whitespace.txt51
-rw-r--r--vim/doc/toggle_option_flag.txt42
-rw-r--r--vim/ftdetect/help.vim4
-rw-r--r--vim/plugin/auto_undodir.vim5
-rw-r--r--vim/plugin/big_file_options.vim5
-rw-r--r--vim/plugin/command_typos.vim5
-rw-r--r--vim/plugin/copy_linebreak.vim5
-rw-r--r--vim/plugin/fixed_join.vim6
-rw-r--r--vim/plugin/insert_suspend_hlsearch.vim48
-rw-r--r--vim/plugin/mail_mutt.vim6
-rw-r--r--vim/plugin/toggle_option_flag.vim5
27 files changed, 490 insertions, 128 deletions
diff --git a/VERSION b/VERSION
index 95d1b4f7..cf4f3cda 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v0.14.0
-Sun Nov 12 07:48:11 UTC 2017
+tejr dotfiles v0.15.0
+Sun Nov 12 11:15:22 UTC 2017
diff --git a/vim/config/backspace.vim b/vim/config/backspace.vim
index a4089a68..db842e12 100644
--- a/vim/config/backspace.vim
+++ b/vim/config/backspace.vim
@@ -1,3 +1,8 @@
-" Let me backspace over pretty much anything, even if it's not text I inserted
-" in the current session
-set backspace=indent,eol,start
+" Let me backspace over pretty much anything
+set backspace=
+" Allow backspacing over autoindent
+set backspace+=indent
+" Allow backspacing over line breaks
+set backspace+=eol
+" Allow backspacing over the start of the insert operation
+set backspace+=start
diff --git a/vim/config/completion.vim b/vim/config/completion.vim
index a8a5c201..566a3a7c 100644
--- a/vim/config/completion.vim
+++ b/vim/config/completion.vim
@@ -9,7 +9,7 @@ if has('wildmenu')
" Use the wild menu, both completing and showing all possible completions
" with a single Tab press, just as I've configured Bash to do
set wildmenu
- set wildmode=longest:list
+ set wildmode=list:longest
" Don't complete certain files that I'm not likely to want to manipulate
" from within Vim:
diff --git a/vim/config/format.vim b/vim/config/format.vim
index 97ebcb11..86557a8c 100644
--- a/vim/config/format.vim
+++ b/vim/config/format.vim
@@ -7,7 +7,7 @@ set nrformats-=octal
silent! set formatoptions+=j
" Show the current formatoptions at a glance
-noremap <silent>
+nnoremap <silent>
\ <Leader>f
\ :<C-U>setlocal formatoptions?<CR>
diff --git a/vim/config/search.vim b/vim/config/search.vim
index 69f3f472..fc861801 100644
--- a/vim/config/search.vim
+++ b/vim/config/search.vim
@@ -5,13 +5,13 @@ if has('extra_search')
set incsearch
nnoremap <silent>
\ <Leader>i
- \ :<C-U>setlocal incsearch! incsearch?<CR>
+ \ :<C-U>set incsearch! incsearch?<CR>
" Highlight search results, \h toggles this
set hlsearch
nnoremap <silent>
\ <Leader>h
- \ :<C-U>setlocal hlsearch! hlsearch?<CR>
+ \ :<C-U>set hlsearch! hlsearch?<CR>
" Pressing ^L will clear highlighting until the next search-related
" operation; quite good because the highlighting gets distracting after
@@ -20,18 +20,4 @@ if has('extra_search')
\ <C-L>
\ :<C-U>nohlsearch<CR><C-L>
- " Clear search highlighting as soon as I enter insert mode, and restore it
- " once I leave it
- if has('autocmd') && v:version >= 701
- augroup dotfiles_highlight
- autocmd!
- autocmd InsertEnter
- \ *
- \ setlocal nohlsearch
- autocmd InsertLeave
- \ *
- \ setlocal hlsearch
- augroup END
- endif
-
endif
diff --git a/vim/config/whitespace.vim b/vim/config/whitespace.vim
index 12d41a4e..981def81 100644
--- a/vim/config/whitespace.vim
+++ b/vim/config/whitespace.vim
@@ -24,12 +24,5 @@ set shiftround
" despite the noble Steve Losh's exhortations
set nojoinspaces
-" Rebind normal J to run plugin-defined join that doesn't jump around, but
-" only if we have the eval feature, because otherwise this mapping won't exist
-" and we should keep the default behaviour
-if has('eval')
- nmap J <Plug>FixedJoin
-endif
-
" \x strips trailing whitespace via a custom plugin
nmap <Leader>x <Plug>StripTrailingWhitespace
diff --git a/vim/doc/auto_backupdir.txt b/vim/doc/auto_backupdir.txt
index c5b6ebad..2990332e 100644
--- a/vim/doc/auto_backupdir.txt
+++ b/vim/doc/auto_backupdir.txt
@@ -1,12 +1,28 @@
-*auto_backupdir.txt* Automatically create 'backupdir' in 'realtimepath'
+*auto_backupdir.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *auto_backupdir*
This plugin attempts to create a directory "backup" in the directory named by
the first element of 'realtimepath', and enables 'backup' with that as the
'backupdir' if it succeeds or if the directory already exists.
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+REQUIREMENTS *auto_backupdir-requirements*
+
+This plugin is only available if 'compatible' is not set.
+
+AUTHOR *auto_backupdir-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *auto_backupdir-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *auto_backupdir-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/auto_swapdir.txt b/vim/doc/auto_swapdir.txt
index f88cfcf3..a5b8f274 100644
--- a/vim/doc/auto_swapdir.txt
+++ b/vim/doc/auto_swapdir.txt
@@ -1,12 +1,28 @@
-*auto_swapdir.txt* Automatically create 'swapdir' in 'realtimepath'
+*auto_swapdir.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *auto_swapdir*
-This plugin attempts to create a directory "swap" in the directory named by the
-first element of 'realtimepath', and enables 'swapfile' with that as the
+This plugin attempts to create a directory "swap" in the directory named by
+the first element of 'runtimepath', and enables 'swapfile' with that as the
'directory' if it succeeds or if the directory already exists.
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+REQUIREMENTS *auto_swapdir-requirements*
+
+This plugin is only available if 'compatible' is not set.
+
+AUTHOR *auto_swapdir-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *auto_swapdir-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *auto_swapdir-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/auto_undodir.txt b/vim/doc/auto_undodir.txt
index c782a70e..af7a49bf 100644
--- a/vim/doc/auto_undodir.txt
+++ b/vim/doc/auto_undodir.txt
@@ -1,14 +1,29 @@
-*auto_undodir.txt* Automatically create 'undodir' in 'realtimepath'
+*auto_undodir.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *auto_undodir*
-This plugin attempts to create a directory "undo" in the directory named by the
-first element of 'realtimepath', and enables 'undofile' with that as the
+This plugin attempts to create a directory "undo" in the directory named by
+the first element of 'runtimepath', and enables 'undofile' with that as the
'undodir' if it succeeds or if the directory already exists.
-It requires the +persistent_undo feature.
+REQUIREMENTS *auto_undodir-requirements*
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+This plugin is only available if 'compatible' is not set. It also requires the
+|+persistent_undo| Vim feature.
+
+AUTHOR *auto_undodir-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *auto_undodir-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *auto_undodir-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/big_file_options.txt b/vim/doc/big_file_options.txt
index 706ba5a7..cab0664e 100644
--- a/vim/doc/big_file_options.txt
+++ b/vim/doc/big_file_options.txt
@@ -1,12 +1,28 @@
-*big_file_options.txt* Disable slow options for big files for faster load
+*big_file_options.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *big_file_options*
This plugin adds an |autocmd| hook to check the file size of an incoming
buffer, and if it's over a certain threshold, disables certain options in order
to make the file a bit easier to edit.
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+REQUIREMENTS *big_file_options-requirements*
+
+This plugin is only available if 'compatible' is not set.
+
+AUTHOR *big_file_options-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *big_file_options-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *big_file_options-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/command_typos.txt b/vim/doc/command_typos.txt
index 93f37df9..938fef27 100644
--- a/vim/doc/command_typos.txt
+++ b/vim/doc/command_typos.txt
@@ -1,12 +1,28 @@
-*command_typos.txt* Bind capital-letter versions of common commands
+*command_typos.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *command_typos*
This plugin defines custom commands like :W, :Qa, and :Wq to match their
lowercase analogues, to forgive me when my pinky finger doesn't roll off the
Shift key quite soon enough after pressing the colon key.
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+REQUIREMENTS *command_typos-requirements*
+
+This plugin is only available if 'compatible' is not set.
+
+AUTHOR *command_typos-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *command_typos-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *command_typos-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/copy_linebreak.txt b/vim/doc/copy_linebreak.txt
index 15e4b1b0..7efbad4b 100644
--- a/vim/doc/copy_linebreak.txt
+++ b/vim/doc/copy_linebreak.txt
@@ -1,25 +1,56 @@
-*copy_linebreak.txt* Mapping to toggle copy-paste friendly linebreak options
+*copy_linebreak.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *copy_linebreak*
This plugin provides mapping targets for a user to set, unset, or toggle
|'linebreak'|-related settings when |'wrap'| is enabled, to switch between
human-readable output and a format friendly for copy-pasting with terminal
emulators or screen/tmux.
-Mappings:
+REQUIREMENTS *copy_linebreak-requirements*
- <Plug>CopyLinebreakEnable
- <Plug>CopyLinebreakDisable
- <Plug>CopyLinebreakToggle
+This plugin is only available if 'compatible' is not set.
-Commands:
+MAPPINGS *copy_linebreak-mappings*
- :CopyLinebreakEnable
- :CopyLinebreakDisable
- :CopyLinebreakToggle
+Mapping targets provided are:
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+|<Plug>CopyLinebreakEnable|: *<Plug>CopyLinebreakEnable*
+ Enable copy-paste friendly line break options.
+|<Plug>CopyLinebreakDisable|: *<Plug>CopyLinebreakDisable*
+ Revert to human-readable line break options.
+|<Plug>CopyLinebreakToggle|: *<Plug>CopyLinebreakToggle*
+ Toggle between the above two states.
+
+There are no default key mappings to any of these targers; you should define
+them yourself in your |vimrc|. For example:
+>
+ :nmap <Leader>b <Plug>CopyLinebreakToggle
+
+COMMANDS *copy_linebreak-commands*
+
+If the |+user_commands| feature is available, commands provided are:
+>
+`:CopyLinebreakEnable`: *:CopyLinebreakEnable*
+ Enable copy-paste friendly line break options.
+`:CopyLinebreakDisable`: *:CopyLinebreakDisable*
+ Revert to human-readable line break options.
+`:CopyLinebreakToggle`: *:CopyLinebreakToggle*
+ Toggle between the above two states.
+
+AUTHOR *copy_linebreak-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *copy_linebreak-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *copy_linebreak-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/detect_background.txt b/vim/doc/detect_background.txt
index ad42221c..570ac47b 100644
--- a/vim/doc/detect_background.txt
+++ b/vim/doc/detect_background.txt
@@ -1,14 +1,37 @@
-*detect_background.txt* Figure out 'background' with a bias towards "dark"
+*detect_background.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *detect_background*
+ *detect_background#DetectBackground()*
-This plugin inspects the $COLORFGBG environment variable to determine whether
-the user is using a terminal with a light background. It reverses Vim's
-built-in attempts to do this, which have the opposite default.
+The |detect_background#DetectBackground()| function provided by this plugin
+inspects the $COLORFGBG environment variable to determine whether the user is
+using a terminal with a light background, and returns the word "dark" or
+"light" accordingly, for use in setting 'background'.
-It does not inspect the value of the $TERM variable or |'term'| at all.
+The function does roughly the reverse of Vim's built-in heuristics to set the
+'background' option, which default to a light background in the absence of
+hints otherwise.
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+Note that this plugin does not inspect the value of the $TERM environment
+variable or the |'term'| option at all, nor the |'t_RB'| option.
+
+REQUIREMENTS *detect_background-requirements*
+
+This plugin is only available if 'compatible' is not set.
+
+AUTHOR *detect_background-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *detect_background-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *detect_background-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/fixed_join.txt b/vim/doc/fixed_join.txt
index df0df251..d12985ef 100644
--- a/vim/doc/fixed_join.txt
+++ b/vim/doc/fixed_join.txt
@@ -1,14 +1,52 @@
-*fixed_join.txt* Join lines in normal mode without moving cursor
+*fixed_join.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *fixed_join*
-This plugin provides a mapping target <Plug>FixedJoin to create a binding for a
-user to join lines in normal mode without the cursor jumping around.
+This plugin provides a mapping target and an optional command to `:join` lines
+in normal mode while keeping the cursor in-place.
-If also provides a :FixedJoin command if you have +user_commands, but this is
-not required.
+REQUIREMENTS *fixed_join-requirements*
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+This plugin is only available if 'compatible' is not set.
+
+MAPPINGS *fixed_join-mappings*
+ *<Plug>FixedJoin*
+
+This plugin provides a mapping target |<Plug>FixedJoin| to create a binding
+for a user to `:join` lines in normal mode without the cursor jumping around.
+
+If the user's configuration does not specify a mapping to this target by the
+time this plugin is loaded, it will attempt to map 'J' in normal mode to
+simply replace the default functionality.
+
+COMMANDS *fixed_join-commands*
+ *:FixedJoin*
+
+The plugin also provides a `:FixedJoin` command if Vim has the
+|+user_commands| feature, but this is not required.
+
+ALTERNATIVE *fixed-join-alternative*
+
+If you don't mind clobbering a mark, this whole plugin can be replaced with
+one mapping in your |vimrc|:
+>
+ :nnoremap J mzJ`z
+<
+This was what the author was doing before writing this plugin as an exercise.
+
+AUTHOR *fixed_join-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *fixed_join-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *fixed_join-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/insert_suspend_hlsearch.txt b/vim/doc/insert_suspend_hlsearch.txt
new file mode 100644
index 00000000..edb51e38
--- /dev/null
+++ b/vim/doc/insert_suspend_hlsearch.txt
@@ -0,0 +1,28 @@
+*insert_suspend_hlsearch.txt* For Vim version 7.0 Last change: 2017 November 12
+
+DESCRIPTION *insert_suspend_hlsearch*
+
+This plugin quietly disables 'hlsearch' search highlighting if enabled when an
+insert operation is started, and puts it back once done, to avoid the
+distracting effect the highlighting can cause while writing.
+
+REQUIREMENTS *insert_suspend_hlsearch-requirements*
+
+This plugin is only available if 'compatible' is not set.
+
+AUTHOR *insert_suspend_hlsearch-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *insert_suspend_hlsearch-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *insert_suspend_hlsearch-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
+off into a separate distribution as it solidifies and this documentation
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/mail_mutt.txt b/vim/doc/mail_mutt.txt
index dbaf72ac..c3f8afaa 100644
--- a/vim/doc/mail_mutt.txt
+++ b/vim/doc/mail_mutt.txt
@@ -1,13 +1,66 @@
-*mail_mutt.txt* Start a mutt(1) email message with a range of lines
+*mail_mutt.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *mail_mutt*
-This plugin provides a :MailMutt command which accepts a range of lines
-defaulting to the entire buffer, writing these lines to a temporary file that
-is then provided to the -i option of the mutt(1) MUA as the initial content of
-a new message.
+This plugin allows you to quickly start writing an email message in Mutt with
+a range of lines from the current buffer as the initial mail content.
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+REQUIREMENTS *mail_mutt-requirements*
+
+This plugin is only available if 'compatible' is not set.
+
+You will want to have the mutt(1) command from the Mutt distribution installed
+to use this plugin. Mutt is available from <http://www.mutt.org/>.
+
+COMMANDS *mail_mutt-commands* *:MailMutt*
+
+This plugin provides a single command `:MailMutt` command which accepts a line
+range prefix defaulting to the entire buffer, writing these lines to a
+temporary file that is then provided to the -i option of the Mutt mail user
+agent, as the initial content of a new message.
+>
+ :MailMutt
+ :.MailMutt
+ :3,6MailMutt
+ :95,$MailMutt
+
+MAPPINGS *mail_mutt-mappings*
+
+Three <Plug> mapping targets are also provided for convenience. No attempt is
+made to map key sequences to these mappings within the plugin; you must do
+this explicitly in your |vimrc|.
+
+ *<Plug>MailMuttLine*
+Th <Plug>MailMuttLine mapping runs `:MailMutt` on the current line in normal
+mode. A binding example might be:
+>
+ :nmap <Leader>ml <Plug>MailMuttLine
+<
+ *<Plug>MailMuttBuffer*
+The <Plug>MailMuttBuffer mapping runs `:MailMutt` on the whole buffer in
+normal mode. A binding example might be:
+>
+ :nmap <Leader>mb <Plug>MailMuttBuffer
+<
+ *<Plug>MailMuttSelected*
+The <Plug>MailMuttSelected mapping runs `:MailMutt` on the selected lines in
+visual or selection mode. A binding example might be:
+>
+ :vmap <Leader>ms <Plug>MailMuttSelected
+<
+AUTHOR *mail_mutt-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *mail_mutt-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *mail_mutt-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/strip_trailing_whitespace.txt b/vim/doc/strip_trailing_whitespace.txt
index d50fbfb7..9e2907d4 100644
--- a/vim/doc/strip_trailing_whitespace.txt
+++ b/vim/doc/strip_trailing_whitespace.txt
@@ -1,15 +1,46 @@
-*strip_trailing_whitespace.txt* Strip trailing whitespace from whole buffer
+*strip_trailing_whitespace.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *strip_trailing_whitespace*
-This plugin is the author's approach to stripping trailing whitespace from an
-entire buffer, including empty lines at the end, without making command noise
-and without moving the cursor from its current position.
+This plugin provides a mapping target and an optional custom command with the
+author's approach to stripping trailing whitespace from an entire buffer,
+including removing empty or whitespace-only lines at the end of the buffer,
+without making command noise and without moving the cursor from its current
+position.
-If also provides a :StripTrailingWhitespace command if you have +user_commands,
-but this is not required.
+REQUIREMENTS *strip_trailing_whitespace-requirements*
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+This plugin is only available if 'compatible' is not set.
+
+COMMANDS *strip_trailing_whitespace-commands*
+
+ *:StripTrailingWhitespace*
+The plugin provides a single `:StripTrailingWhitespace` command if Vim has the
+|+user_commands| feature, but this is not required. It operates on the entire
+buffer, and accepts neither a range nor arguments.
+
+MAPPINGS *strip_trailing_whitespace-mappings*
+
+ *<Plug>StripTrailingWhitespace*
+The single mapping target provided is |<Plug>StripTrailingWhitespace|,
+mappable in any mode. There is no default key mapping to the target; you
+should define this yourself in your |vimrc|. For example:
+>
+ :nmap <Leader>x <Plug>StripTrailingWhitespace>
+
+AUTHOR *strip_trailing_whitespace-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *strip_trailing_whitespace-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *strip_trailing_whitespace-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/doc/toggle_option_flag.txt b/vim/doc/toggle_option_flag.txt
index 9415ae6b..be035221 100644
--- a/vim/doc/toggle_option_flag.txt
+++ b/vim/doc/toggle_option_flag.txt
@@ -1,17 +1,37 @@
-*toggle_option_flag.txt* Commands to toggle option flags
+*toggle_option_flag.txt* For Vim version 7.0 Last change: 2017 November 12
-Author: Tom Ryder <tom@sanctum.geek.nz>
-License: Same terms as Vim itself (see |license|)
+DESCRIPTION *toggle_option_flag*
-This plugin provides commands :ToggleOptionFlag and :ToggleOptionFlagLocal to
-toggle the values of options like |'formatoptions'| or |'complete'| that have
-values comprised of single-character or comma-separated flags. The author
+ *:ToggleOptionFlag* *:ToggleOptionFlagLocal*
+This plugin provides `:ToggleOptionFlag` and `:ToggleOptionFlagLocal` commands
+to toggle the values of options like |'formatoptions'| or |'complete'| that
+have values comprised of single-character or comma-separated flags. The author
originally designed it for toggling flags in |'formatoptions'| quickly.
- :ToggleOptionFlag formatoptions a
- :ToggleOptionFlag switchbuf useopen
- :ToggleOptionFlagLocal shortmess I
+EXAMPLES *toggle_option_flag-examples*
+>
+ :ToggleOptionFlag formatoptions a
+ :ToggleOptionFlag switchbuf useopen
+ :ToggleOptionFlagLocal shortmess I
+<
+REQUIREMENTS *toggle_option_flag-requirements*
-This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun
+This plugin is only available if 'compatible' is not set. It also requires the
+|+user_commands| Vim feature.
+
+AUTHOR *toggle_option_flag-author*
+
+Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
+
+LICENSE *toggle_option_flag-license*
+
+Licensed for distribution under the same terms as Vim itself (see |license|).
+
+DISTRIBUTION *toggle_option_flag-distribution*
+
+This plugin lives in Tom Ryder's "dotfiles" suite, and may eventually be spun
off into a separate distribution as it solidifies and this documentation
-improves.
+improves. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
+information.
+
+ vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/ftdetect/help.vim b/vim/ftdetect/help.vim
new file mode 100644
index 00000000..b516ed7e
--- /dev/null
+++ b/vim/ftdetect/help.vim
@@ -0,0 +1,4 @@
+" Custom Vim help documentation filetype detection
+autocmd BufNewFile,BufRead
+ \ **/vim/**/doc/*.txt,**/.vim/**/doc/*.txt
+ \ setlocal filetype=help
diff --git a/vim/plugin/auto_undodir.vim b/vim/plugin/auto_undodir.vim
index 9a686fb1..cf8d896a 100644
--- a/vim/plugin/auto_undodir.vim
+++ b/vim/plugin/auto_undodir.vim
@@ -5,7 +5,10 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('g:loaded_auto_undodir') || &compatible || !has('persistent_undo')
+if exists('g:loaded_auto_undodir') || &compatible
+ finish
+endif
+if !has('persistent_undo')
finish
endif
let g:loaded_auto_undodir = 1
diff --git a/vim/plugin/big_file_options.vim b/vim/plugin/big_file_options.vim
index cbbacc42..f7fa0281 100644
--- a/vim/plugin/big_file_options.vim
+++ b/vim/plugin/big_file_options.vim
@@ -5,7 +5,10 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('g:loaded_big_file_options') || &compatible || !has('autocmd')
+if exists('g:loaded_big_file_options') || &compatible
+ finish
+endif
+if !has('autocmd')
finish
endif
let g:loaded_big_file_options = 1
diff --git a/vim/plugin/command_typos.vim b/vim/plugin/command_typos.vim
index afc04ed3..6f34c680 100644
--- a/vim/plugin/command_typos.vim
+++ b/vim/plugin/command_typos.vim
@@ -7,7 +7,10 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('g:loaded_command_typos') || &compatible || !has('user_commands')
+if exists('g:loaded_command_typos') || &compatible
+ finish
+endif
+if !has('user_commands')
finish
endif
let g:loaded_command_typos = 1
diff --git a/vim/plugin/copy_linebreak.vim b/vim/plugin/copy_linebreak.vim
index 158282bf..9d241d5a 100644
--- a/vim/plugin/copy_linebreak.vim
+++ b/vim/plugin/copy_linebreak.vim
@@ -6,7 +6,10 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('g:loaded_copy_linebreak') || &compatible || !has('linebreak')
+if exists('g:loaded_copy_linebreak') || &compatible
+ finish
+endif
+if !has('linebreak')
finish
endif
let g:loaded_copy_linebreak = 1
diff --git a/vim/plugin/fixed_join.vim b/vim/plugin/fixed_join.vim
index 83977c2f..2e7f2abd 100644
--- a/vim/plugin/fixed_join.vim
+++ b/vim/plugin/fixed_join.vim
@@ -31,6 +31,12 @@ noremap <silent> <unique>
\ <Plug>FixedJoin
\ :<C-U>call <SID>FixedJoin()<CR>
+" If there's no mapping to it already, try to bind normal-mode J to it, to
+" simply replace the old functionality
+nmap <unique>
+ \ J
+ \ <Plug>FixedJoin
+
" Create a command as well in case it's useful
if has('user_commands')
command -nargs=0
diff --git a/vim/plugin/insert_suspend_hlsearch.vim b/vim/plugin/insert_suspend_hlsearch.vim
new file mode 100644
index 00000000..378febc8
--- /dev/null
+++ b/vim/plugin/insert_suspend_hlsearch.vim
@@ -0,0 +1,48 @@
+"
+" insert_suspend_hlsearch.vim: If 'hlsearch' is enabled, switch it off when
+" the user starts an insert mode operation, and back on again when they're
+" done.
+"
+" Author: Tom Ryder <tom@sanctum.geek.nz>
+" License: Same as Vim itself
+"
+if exists('g:loaded_insert_suspend_hlsearch') || &compatible
+ finish
+endif
+" InsertEnter isn't an autocmd event until 7.0
+if !has('autocmd') || v:version < 700
+ finish
+endif
+let g:loaded_insert_suspend_hlsearch = 1
+
+" When entering insert mode, copy the current value of the 'hlsearch' option
+" into a script variable; if it's enabled, suspend it
+function s:InsertEnter()
+ let s:hlsearch = &hlsearch
+ echo &hlsearch
+ if s:hlsearch
+ set nohlsearch
+ endif
+ return
+endfunction
+
+" When leaving insert mode, if 'hlsearch' was enabled when this operation
+" started, restore it
+function s:InsertLeave()
+ if s:hlsearch
+ set hlsearch
+ endif
+ return
+endfunction
+
+" Clear search highlighting as soon as I enter insert mode, and restore it
+" once I leave it
+augroup insert_suspend_hlsearch
+ autocmd!
+ autocmd InsertEnter
+ \ *
+ \ call <SID>InsertEnter()
+ autocmd InsertLeave
+ \ *
+ \ call <SID>InsertLeave()
+augroup END
diff --git a/vim/plugin/mail_mutt.vim b/vim/plugin/mail_mutt.vim
index 24ce01dd..5170fb52 100644
--- a/vim/plugin/mail_mutt.vim
+++ b/vim/plugin/mail_mutt.vim
@@ -5,7 +5,10 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('g:loaded_mail_mutt') || &compatible || !has('user_commands')
+if exists('g:loaded_mail_mutt') || &compatible
+ finish
+endif
+if !has('user_commands')
finish
endif
let g:loaded_mail_mutt = 1
@@ -27,7 +30,6 @@ function! s:MailMutt(start, end)
let l:command = 'write ' . fnameescape(l:tf)
execute l:range . l:command
-
" Run mutt(1) with that file as its input
execute '!mutt -i ' . shellescape(l:tf)
diff --git a/vim/plugin/toggle_option_flag.vim b/vim/plugin/toggle_option_flag.vim
index 5c848368..bc7ccd78 100644
--- a/vim/plugin/toggle_option_flag.vim
+++ b/vim/plugin/toggle_option_flag.vim
@@ -5,7 +5,10 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('g:loaded_toggle_option_flag') || &compatible || !has('user_commands')
+if exists('g:loaded_toggle_option_flag') || &compatible
+ finish
+endif
+if !has('user_commands')
finish
endif
let g:loaded_toggle_option_flag = 1