aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-09-15 20:24:33 +0200
committerTeddy Wing2021-09-21 20:32:42 +0200
commitfb45f7acc15a9d7a9f2e4a256dd82461adb6cfd9 (patch)
tree8c6ae252e221e981966f38d9138a433256ba0b2a
parent4124b09bdbcf4c76fcdf389fcec1e9c59838dac1 (diff)
downloaddotvim-fb45f7acc15a9d7a9f2e4a256dd82461adb6cfd9.tar.bz2
ftplugin/mail.vim: Add bindings to add and remove the 'a' format option
I've been editing email headers in Vim recently (previously I only did that in Mutt's line editor). With automatic formatting, the headers can get messed up due to reflow. Add bindings so we can quickly disable automatic paragraph formatting when we need to.
-rw-r--r--ftplugin/mail.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/ftplugin/mail.vim b/ftplugin/mail.vim
index b42fa34..6d4630e 100644
--- a/ftplugin/mail.vim
+++ b/ftplugin/mail.vim
@@ -20,3 +20,8 @@ setlocal comments-=mb:* comments+=fb:*
" Remove last two empty lines below signature
nnoremap <buffer> <leader>e m`Gdk``
+
+
+" Toggle paragraph auto-formatting
+nnoremap <buffer> [a :setlocal formatoptions-=a<CR>
+nnoremap <buffer> ]a :setlocal formatoptions+=a<CR>