aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vim/config/command.vim14
-rw-r--r--vim/plugin/mail_mutt.vim15
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 <silent>
\ <Leader>D
\ :<C-U>read !date -u<CR>
+" \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 <silent>
- \ <Leader>m
- \ :<C-U>.MailMutt<CR>
+nmap <Leader>m <Plug>MailMuttLine
" \M in normal mode starts a mail message with the whole buffer
-nmap <silent>
- \ <Leader>M
- \ :<C-U>%MailMutt<CR>
-" \m in visual mode starts a mail message with the selected lines
-vmap <silent>
- \ <Leader>m
- \ :MailMutt<CR>
+nmap <Leader>M <Plug>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 <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>