aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-07 19:39:32 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-07 21:31:47 +1200
commitbda650a7e5e72a9205112884cd7ba18198dff8f9 (patch)
tree0f6e874ad2141dbb648b83a8eeb08c6a94addc6a
parentInclude .gvimrc patterns for vim filetype (diff)
downloaddotfiles-bda650a7e5e72a9205112884cd7ba18198dff8f9.tar.gz
dotfiles-bda650a7e5e72a9205112884cd7ba18198dff8f9.zip
Replace mail_mutt.vim with mim(1df)
Way better, and more generally useful.
-rw-r--r--.gitignore3
-rw-r--r--.gitmodules3
-rw-r--r--Makefile4
-rw-r--r--README.md1
-rwxr-xr-xbin/mim.mi512
-rw-r--r--man/man1/mim.1df20
m---------vim/bundle/mail_mutt0
-rw-r--r--vim/vimrc7
8 files changed, 40 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore
index f9ae6fcc..f809b6f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,6 +61,9 @@ bin/med
bin/mex
bin/mftl
bin/mi5
+bin/mim
+bin/mim.sh
+bin/mim.m4
bin/min
bin/mkcp
bin/mkmv
diff --git a/.gitmodules b/.gitmodules
index 82c358ff..e8e15892 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -14,9 +14,6 @@
[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/markdown_autoformat"]
path = vim/bundle/markdown_autoformat
url = https://sanctum.geek.nz/code/vim-markdown-autoformat.git
diff --git a/Makefile b/Makefile
index e5652913..6c9d0fab 100644
--- a/Makefile
+++ b/Makefile
@@ -142,6 +142,7 @@ BINS = bin/ap \
bin/med \
bin/mex \
bin/mftl \
+ bin/mim \
bin/min \
bin/mkcp \
bin/mkmv \
@@ -218,6 +219,7 @@ BINS = bin/ap \
BINS_M4 = bin/chn.m4 \
bin/dfv.m4 \
bin/edda.m4 \
+ bin/mim.m4 \
bin/oii.m4 \
bin/pst.m4 \
bin/swr.m4 \
@@ -228,6 +230,7 @@ BINS_M4 = bin/chn.m4 \
BINS_SH = bin/chn.sh \
bin/dfv.sh \
bin/edda.sh \
+ bin/mim.sh \
bin/oii.sh \
bin/pst.sh \
bin/swr.sh \
@@ -297,6 +300,7 @@ clean distclean:
bin/chn.sh: bin/chn.m4 include/mktd.m4
bin/dfv.sh: bin/dfv.m4 include/mktd.m4
bin/edda.sh: bin/edda.m4 include/mktd.m4
+bin/mim.sh: bin/mim.m4 include/mktd.m4
bin/oii.sh: bin/oii.m4 include/mktd.m4
bin/pst.sh: bin/pst.m4 include/mktd.m4
bin/swr.sh: bin/swr.m4 include/mktd.m4
diff --git a/README.md b/README.md
index b0ebb8e8..447e7db2 100644
--- a/README.md
+++ b/README.md
@@ -538,6 +538,7 @@ Installed by the `install-bin` target:
it exits with success or failure. Good for quick tests.
* `mex(1df)` makes given filenames in `$PATH` executable.
* `mi5(1df)` is a crude preprocessor for `m4`.
+* `mim(1df)` starts an interactive Mutt message with its input.
* `mftl(1df)` finds usable-looking targets in makefiles.
* `mkcp(1df)` creates a directory and copies preceding arguments into it.
* `mkmv(1df)` creates a directory and moves preceding arguments into it.
diff --git a/bin/mim.mi5 b/bin/mim.mi5
new file mode 100755
index 00000000..1c04e185
--- /dev/null
+++ b/bin/mim.mi5
@@ -0,0 +1,12 @@
+# Open up Mutt to a new message starting with input
+
+<%
+include(`include/mktd.m4')
+%>
+
+# Direct all input (stdin and files) into a tempfile
+tf=$td/out
+cat -- "${@:--}" > "$tf" || exit
+
+# Run Mutt on the tempfile, showing it the TTY for its input
+mutt -i "$tf" < /dev/tty
diff --git a/man/man1/mim.1df b/man/man1/mim.1df
new file mode 100644
index 00000000..e70c7fa5
--- /dev/null
+++ b/man/man1/mim.1df
@@ -0,0 +1,20 @@
+.TH MIM 1df "June 2018" "Manual page for mim"
+.SH NAME
+.B mim
+\- start a new Mutt message with the input
+.SH SYNOPSIS
+.B mim
+file1 [file2 ...]
+.br
+curl http://example.net/ |
+.B mim
+.SH DESCRIPTION
+.B mim
+takes all its input and puts it into a temporary file for mutt(1) to read with
+its -i option, redirecting the terminal input appropriately. This allows you to
+concatenate or pipe input straight into a new Mutt message.
+.P
+The author wrote it so that he could use ! and :! commands in Vim with it, to
+email sections of buffers to people conveniently.
+.SH AUTHOR
+Tom Ryder <tom@sanctum.geek.nz>
diff --git a/vim/bundle/mail_mutt b/vim/bundle/mail_mutt
deleted file mode 160000
-Subproject 3e0e4306641a759758a4eb746708f0efec9cc7e
diff --git a/vim/vimrc b/vim/vimrc
index 723e69da..25907ffb 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -428,13 +428,6 @@ nmap ]<Space> <Plug>PutBlankLinesBelow
" \b toggles copy-pasteable linebreak settings
nmap <Leader>b <Plug>CopyLinebreakToggle
-" \m in visual/select mode starts a mail message with the selected lines
-vmap <Leader>m <Plug>MailMuttSelected
-" \m in normal mode starts a mail message with the current line
-nmap <Leader>m <Plug>MailMuttLine
-" \M in normal mode starts a mail message with the whole buffer
-nmap <Leader>M <Plug>MailMuttBuffer
-
" \x strips trailing whitespace via a custom plugin
nmap <Leader>x <Plug>StripTrailingWhitespace