From 30e14ab95bdf039ac4abac20abd881d9909b1d5b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 8 Nov 2017 14:40:38 +1300 Subject: Beginnings of a buffer-to-Mutt mailer plugin --- vim/config/command.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vim/config/command.vim') diff --git a/vim/config/command.vim b/vim/config/command.vim index 09ee0f40..a8861583 100644 --- a/vim/config/command.vim +++ b/vim/config/command.vim @@ -34,3 +34,13 @@ nnoremap nnoremap \ D \ :read !date -u + +" \m fires up mutt with either the whole buffer or the text +function s:Mutt() + let l:tf = tempname() + execute 'write '.fnameescape(l:tf) + execute '!mutt -i '.shellescape(l:tf) +endfunction +nnoremap + \ m + \ :call Mutt() -- cgit v1.2.3 From 209bea8a39edd8313d1c168071c4ec2a926f0e53 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 10 Nov 2017 21:44:28 +1300 Subject: Remove 'shellslash' setting This will allow the Windows-specific stuff in my new auto_* plugins to quote filenames correctly. --- vim/config/command.vim | 6 ------ 1 file changed, 6 deletions(-) (limited to 'vim/config/command.vim') diff --git a/vim/config/command.vim b/vim/config/command.vim index 09ee0f40..a789fd6d 100644 --- a/vim/config/command.vim +++ b/vim/config/command.vim @@ -20,12 +20,6 @@ endif " Don't write the output of :make to the terminal set shellpipe=> -" Always use forward slashes, I very seldom need to use Vim on Windows for -" more than scratch space anyway -if exists('+shellslash') - set shellslash -endif - " \d inserts the current local date from date(1) nnoremap \ d -- cgit v1.2.3 From 3e29d5a95693a5ffd5e78622f560f415743b0736 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 10 Nov 2017 21:48:23 +1300 Subject: Adjust some whitespace and comment layout --- vim/config/command.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'vim/config/command.vim') diff --git a/vim/config/command.vim b/vim/config/command.vim index a789fd6d..031772e9 100644 --- a/vim/config/command.vim +++ b/vim/config/command.vim @@ -4,6 +4,9 @@ set history=2000 " Always tell me the number of lines changed by a command set report=0 +" Don't write the output of :make to the terminal +set shellpipe=> + " Command-line based features if has('cmdline_info') @@ -15,10 +18,8 @@ if has('cmdline_info') " Show the mode we're using if not normal mode (e.g. --INSERT--) set showmode -endif -" Don't write the output of :make to the terminal -set shellpipe=> +endif " \d inserts the current local date from date(1) nnoremap -- cgit v1.2.3 From fe8e94bea39895f2544ae83916da83a4f2affa21 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 11 Nov 2017 00:59:12 +1300 Subject: Add new mail_mutt.vim plugin, apply mappings This plugin provides a shortcut for staring email messages in Mutt with a range of lines. --- vim/config/command.vim | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'vim/config/command.vim') diff --git a/vim/config/command.vim b/vim/config/command.vim index a8861583..705f29b0 100644 --- a/vim/config/command.vim +++ b/vim/config/command.vim @@ -35,12 +35,15 @@ nnoremap \ D \ :read !date -u -" \m fires up mutt with either the whole buffer or the text -function s:Mutt() - let l:tf = tempname() - execute 'write '.fnameescape(l:tf) - execute '!mutt -i '.shellescape(l:tf) -endfunction -nnoremap +" \m in normal mode starts a mail message with the current line +nmap + \ m + \ :.MailMutt +" \M in normal mode starts a mail message with the whole buffer +nmap + \ M + \ :%MailMutt +" \m in visual mode starts a mail message with the selected lines +vmap \ m - \ :call Mutt() + \ :MailMutt -- cgit v1.2.3 From f9600abb2182b467dfd24ce16e3eebed26723338 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 11 Nov 2017 01:05:15 +1300 Subject: Move mutt_mail.vim line select logic into plugin This makes the configuration shorter and easier to read. --- vim/config/command.vim | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'vim/config/command.vim') diff --git a/vim/config/command.vim b/vim/config/command.vim index 705f29b0..e3f7c473 100644 --- a/vim/config/command.vim +++ b/vim/config/command.vim @@ -35,15 +35,9 @@ nnoremap \ D \ :read !date -u +" \m in visual/select mode starts a mail message with the selected lines +vmap m MailMuttSelected " \m in normal mode starts a mail message with the current line -nmap - \ m - \ :.MailMutt +nmap m MailMuttLine " \M in normal mode starts a mail message with the whole buffer -nmap - \ M - \ :%MailMutt -" \m in visual mode starts a mail message with the selected lines -vmap - \ m - \ :MailMutt +nmap M MailMuttBuffer -- cgit v1.2.3