aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-05-31 10:40:52 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-05-31 10:40:52 +1200
commit19448ce894eb2c25af150157234b5fc526dc017f (patch)
tree52ca515f90a23fde89b4bb054e600d35c7261375
parentSpin off copy_linebreak Vim plugin (diff)
downloaddotfiles-19448ce894eb2c25af150157234b5fc526dc017f.tar.gz
dotfiles-19448ce894eb2c25af150157234b5fc526dc017f.zip
Spin off mail_mutt Vim plugin
-rw-r--r--.gitmodules3
-rw-r--r--Makefile7
m---------vim/bundle/mail_mutt0
-rw-r--r--vim/doc/mail_mutt.txt66
-rw-r--r--vim/plugin/mail_mutt.vim56
5 files changed, 3 insertions, 129 deletions
diff --git a/.gitmodules b/.gitmodules
index 6bc0a4e9..c57005ed 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -8,6 +8,9 @@
[submodule "vim/bundle/insert_suspend_hlsearch"]
path = vim/bundle/insert_suspend_hlsearch
url = https://sanctum.geek.nz/code/vim-insert-suspend-hlsearch.git
+[submodule "vim/bundle/mail_mutt"]
+ path = vim/bundle/mail_mutt
+ url = https://sanctum.geek.nz/code/vim-mail-mutt.git
[submodule "vim/bundle/toggle_option_flags"]
path = vim/bundle/toggle_option_flags
url = https://sanctum.geek.nz/code/vim-toggle-option-flags.git
diff --git a/Makefile b/Makefile
index d73dcc84..ff8b493c 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,6 @@
dist-vim-plugin-auto-undodir \
dist-vim-plugin-big-file-options \
dist-vim-plugin-command-typos \
- dist-vim-plugin-mail-mutt \
dist-vim-plugin-strip-trailing-whitespace
.SUFFIXES:
@@ -667,7 +666,6 @@ dist-vim-plugin: dist-vim-plugin-auto-backupdir \
dist-vim-plugin-auto-undodir \
dist-vim-plugin-big-file-options \
dist-vim-plugin-command-typos \
- dist-vim-plugin-mail-mutt \
dist-vim-plugin-strip-trailing-whitespace
dist-vim-plugin-auto-backupdir: \
@@ -695,11 +693,6 @@ dist-vim-plugin-command-typos: \
vim/doc/command_typos.txt \
VERSION
sh dist/vim-plugin.sh command_typos
-dist-vim-plugin-mail-mutt: \
- vim/plugin/mail_mutt.vim \
- vim/doc/mail_mutt.txt \
- VERSION
- sh dist/vim-plugin.sh mail_mutt
dist-vim-plugin-strip-trailing-whitespace: \
vim/plugin/strip_trailing_whitespace.vim \
vim/doc/strip_trailing_whitespace.txt \
diff --git a/vim/bundle/mail_mutt b/vim/bundle/mail_mutt
new file mode 160000
+Subproject 8f417d2ac92b1247b24103963e64bf63d627de3
diff --git a/vim/doc/mail_mutt.txt b/vim/doc/mail_mutt.txt
deleted file mode 100644
index 1129651d..00000000
--- a/vim/doc/mail_mutt.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-*mail_mutt.txt* For Vim version 7.0 Last change: 2017 November 12
-
-DESCRIPTION *mail_mutt*
-
-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.
-
-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. See <https://sanctum.geek.nz/cgit/dotfiles.git/about/> for more
-information.
-
- vim:tw=78:ts=8:ft=help:norl:
diff --git a/vim/plugin/mail_mutt.vim b/vim/plugin/mail_mutt.vim
deleted file mode 100644
index 63cae2f6..00000000
--- a/vim/plugin/mail_mutt.vim
+++ /dev/null
@@ -1,56 +0,0 @@
-"
-" mail_mutt.vim: Start a mutt(1) message with the lines in the given range,
-" defaulting to the entire buffer.
-"
-" Author: Tom Ryder <tom@sanctum.geek.nz>
-" License: Same as Vim itself
-"
-if exists('g:loaded_mail_mutt') || &compatible
- finish
-endif
-if !has('user_commands')
- finish
-endif
-let g:loaded_mail_mutt = 1
-
-" Declare function
-function! s:MailMutt(start, end)
-
- " Check we'll have mutt(1) to execute
- if !executable('mutt')
- echoerr 'mutt not found in $PATH'
- finish
- endif
-
- " Create a temporary file
- let l:tf = tempname()
-
- " Write the contents of the buffer to it
- let l:range = a:start . ',' . a: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)
-
-endfunction
-
-" Create a command to wrap around that function
-command -nargs=0 -range=%
- \ MailMutt
- \ call <SID>MailMutt(<line1>, <line2>)
-
-" Mapping to mail current line in normal mode
-nnoremap <silent> <unique>
- \ <Plug>MailMuttLine
- \ :<C-U>.MailMutt<CR>
-
-" Mapping to mail whole buffer in normal mode
-nnoremap <silent> <unique>
- \ <Plug>MailMuttBuffer
- \ :<C-U>%MailMutt<CR>
-
-" Mapping to mail selected lines in visual/select mode
-vnoremap <silent> <unique>
- \ <Plug>MailMuttSelected
- \ :MailMutt<CR>