aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2025-02-21 09:43:26 +0100
committerChristian Clason <ch.clason+github@icloud.com>2025-02-21 10:03:52 +0100
commit2b7d9d1900620484357fe71fa1f944a97e5ab0a0 (patch)
treedfe9e5db2a702165df785c7a8b2e077c418e6df9
parent40dfc4ebd18d80a921518446914a82f519a851fa (diff)
downloadrneovim-2b7d9d1900620484357fe71fa1f944a97e5ab0a0.tar.gz
rneovim-2b7d9d1900620484357fe71fa1f944a97e5ab0a0.tar.bz2
rneovim-2b7d9d1900620484357fe71fa1f944a97e5ab0a0.zip
vim-patch:27f5136: runtime(mail): add commentstring '> %s' to ftplugin
The new native commenting functionality is currently not used when editing mail. One could reasonably expect it to change the "quote" state of any given line in the mail (i.e. the preceding ">"), which would be very handy and feel natural when editing mail. Especially since the current file already uses "setlocal comments+=n:>". Solution: Add commentstring to `> %s` to be used in files of type mail. closes: vim/vim#16669 https://github.com/vim/vim/commit/27f51367613a150877e88d2379409bebdf32052b Co-authored-by: Lucas Eekhof <105216949+eekhof@users.noreply.github.com>
-rw-r--r--runtime/doc/filetype.txt2
-rw-r--r--runtime/ftplugin/mail.vim7
2 files changed, 6 insertions, 3 deletions
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index cc520484b3..b3fe13bfbd 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -708,7 +708,7 @@ Options:
You can also format quoted text with |gq|.
Local mappings:
-<LocalLeader>q or \\MailQuote
+<LocalLeader>q or \MailQuote
Quotes the text selected in Visual mode, or from the cursor position
to the end of the file in Normal mode. This means "> " is inserted in
each line.
diff --git a/runtime/ftplugin/mail.vim b/runtime/ftplugin/mail.vim
index 3cef84f528..de88f4d1e8 100644
--- a/runtime/ftplugin/mail.vim
+++ b/runtime/ftplugin/mail.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Mail
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2023 Aug 10
+" Last Change: 2025 Feb 20
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" Only do this when not done yet for this buffer
@@ -10,7 +10,7 @@ if exists("b:did_ftplugin")
endif
let b:did_ftplugin = 1
-let b:undo_ftplugin = "setl modeline< tw< fo< comments<"
+let b:undo_ftplugin = "setl modeline< tw< fo< comments< commentstring<"
" Don't use modelines in e-mail messages, avoid trojan horses and nasty
" "jokes" (e.g., setting 'textwidth' to 5).
@@ -24,6 +24,9 @@ endif
" Set 'formatoptions' to break text lines and keep the comment leader ">".
setlocal fo+=tcql
+" Set commentstring to quoting sign ">" so comment shortcuts can be used to
+" edit quoted parts of mail
+setlocal commentstring=>\ %s
" Add n:> to 'comments, in case it was removed elsewhere
setlocal comments+=n:>