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 ++++---------- vim/plugin/mail_mutt.vim | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) 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 diff --git a/vim/plugin/mail_mutt.vim b/vim/plugin/mail_mutt.vim index 67444e4d..9bb4abd4 100644 --- a/vim/plugin/mail_mutt.vim +++ b/vim/plugin/mail_mutt.vim @@ -39,3 +39,18 @@ endfunction command -nargs=0 -range=% \ MailMutt \ call MailMutt(, ) + +" Mapping to mail current line in normal mode +nnoremap + \ MailMuttLine + \ :.MailMutt + +" Mapping to mail whole buffer in normal mode +nnoremap + \ MailMuttBuffer + \ :%MailMutt + +" Mapping to mail selected lines in visual/select mode +vnoremap + \ MailMuttSelected + \ :MailMutt -- cgit v1.2.3