From c4fdd3b072adc53206efa6310fdfd197f90c8b96 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 28 Feb 2026 08:00:17 +0800 Subject: [PATCH] vim-patch:9148644: runtime(env): add ftplugin for env filetype (#38098) Patch 9.2.0033 (vim/vim#19260) introduced a dedicated `env` filetype for .env files, which were previously detected as `sh`. This left env files without `commentstring`, `comments`, or `formatoptions` since no ftplugin was added alongside the new filetype. Add runtime/ftplugin/env.vim to set these options, matching the behavior that .env files had when they used the `sh` filetype. closes: vim/vim#19522 https://github.com/vim/vim/commit/9148644c1eb73faad702eacac2d40925c0c9a2d0 Co-authored-by: snelling-a <72226000+snelling-a@users.noreply.github.com> --- runtime/ftplugin/env.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 runtime/ftplugin/env.vim diff --git a/runtime/ftplugin/env.vim b/runtime/ftplugin/env.vim new file mode 100644 index 0000000000..ad1ee7f11c --- /dev/null +++ b/runtime/ftplugin/env.vim @@ -0,0 +1,19 @@ +" Vim filetype plugin file +" Language: env +" Maintainer: This runtime file is looking for a new maintainer. +" Last Change: 2026 Feb 27 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +let b:undo_ftplugin = "setl com< cms< fo<" + +setlocal comments=b:# commentstring=#\ %s formatoptions-=t formatoptions+=croql + +let &cpo = s:cpo_save +unlet s:cpo_save