]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime: guard recommended style settings consistently
authorChristian Brabandt <cb@256bit.org>
Sun, 28 Jun 2026 16:18:45 +0000 (16:18 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 28 Jun 2026 16:18:45 +0000 (16:18 +0000)
Normalize the 15 existing guards to the documented two-level form
get(g:, 'X_recommended_style', get(g:, 'filetype_recommended_style', 1)):
fix the two non-standard "!exists() || != 0" guards (python, arduino) and
tolk's wrong fallback variable, and convert the simple one-level guards.

Add the guard to filetype plugins that set stylistic indentation/format
options without one: aap, abap, ada, cabal, cobol, elixir, falcon,
graphql, heex, idris2, mermaid, occam, racket, scala, swift, tera.

Settings that are required rather than stylistic are left untouched, e.g.
make/gomod/scdoc (mandatory tabs), chatito and vroom (indent mandated by
the format), and the textwidth/formatoptions cases in gitcommit/help/
jjdescription.

Supported by AI.

fixes:  #20036
closes: #20650

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
31 files changed:
runtime/ftplugin/aap.vim
runtime/ftplugin/abap.vim
runtime/ftplugin/ada.vim
runtime/ftplugin/arduino.vim
runtime/ftplugin/cabal.vim
runtime/ftplugin/cobol.vim
runtime/ftplugin/elixir.vim
runtime/ftplugin/falcon.vim
runtime/ftplugin/gdscript.vim
runtime/ftplugin/gleam.vim
runtime/ftplugin/go.vim
runtime/ftplugin/graphql.vim
runtime/ftplugin/hare.vim
runtime/ftplugin/haredoc.vim
runtime/ftplugin/heex.vim
runtime/ftplugin/idris2.vim
runtime/ftplugin/markdown.vim
runtime/ftplugin/mermaid.vim
runtime/ftplugin/meson.vim
runtime/ftplugin/occam.vim
runtime/ftplugin/python.vim
runtime/ftplugin/racket.vim
runtime/ftplugin/ruby.vim
runtime/ftplugin/rust.vim
runtime/ftplugin/sass.vim
runtime/ftplugin/scala.vim
runtime/ftplugin/swift.vim
runtime/ftplugin/tera.vim
runtime/ftplugin/tolk.vim
runtime/ftplugin/yaml.vim
runtime/ftplugin/zig.vim

index cd7e2a425e24ff56b4d935d2fc782e981aa0f7c1..b6e7b0ec0fe287d5af79e3bb7498d3ea59fbd18f 100644 (file)
@@ -2,6 +2,7 @@
 " Language:    Aap recipe
 " Maintainer:  The Vim Project <https://github.com/vim/vim>
 " Last Change: 2024 Jan 14
+"              2026 Jun 27 by Vim Project (add recommended style guard)
 " Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
 " Only do this when not done yet for this buffer
@@ -25,7 +26,10 @@ setlocal comments=s:#\ -,m:#\ \ ,e:#,n:#,fb:-
 setlocal commentstring=#\ %s
 
 " Expand tabs to spaces to avoid trouble.
-setlocal expandtab
+if get(g:, 'aap_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal expandtab
+endif
 
 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
   let b:browsefilter = "Aap Recipe Files (*.aap)\t*.aap\n"
index fd6b8418fe005844cc03eef59795fa8cd69b4a94..5a2148b8e2fab19d7307190efe43d644cb38e078 100644 (file)
@@ -6,6 +6,7 @@
 " Last Change: 2023 Aug 28 by Vim Project (undo_ftplugin)
 "               2024 Jan 14 by Vim Project (browsefilter)
 "               2025 Jun 08 by Riley Bruins <ribru17@gmail.com> ('comments', 'commentstring')
+"               2026 Jun 27 by Vim Project (add recommended style guard)
 " --------------------------------------------------------------------------
 
 " Only do this when not done yet for this buffer
@@ -17,7 +18,10 @@ let b:did_ftplugin = 1
 let s:cpo_save = &cpo
 set cpo&vim
 
-setlocal softtabstop=2 shiftwidth=2
+if get(g:, 'abap_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal softtabstop=2 shiftwidth=2
+endif
 setlocal suffixesadd=.abap
 setlocal commentstring=\"\ %s
 setlocal comments=:\",:*
index 7d2bdae9a89a5ea5776a9635c6d390a579072dfb..2e90ed326cc5cdba2362e53ad1bb840c55bc24c2 100644 (file)
@@ -24,6 +24,7 @@
 "                            set undo_ftplugin
 "                            mark as unmaintained
 "                            use buffer-local abbreviation
+"              27.06.2026    add recommended style guard
 "    Help Page: ft-ada-plugin
 "------------------------------------------------------------------------------
 " Provides mapping overrides for tag jumping that figure out the current
@@ -148,9 +149,12 @@ if exists("g:ada_folding")
    elseif g:ada_folding[0] == 's'
       setlocal foldmethod=syntax
    endif
-   setlocal tabstop=8
-   setlocal softtabstop=3
-   setlocal shiftwidth=3
+   if get(g:, 'ada_recommended_style',
+   \ get(g:, 'filetype_recommended_style', 1))
+      setlocal tabstop=8
+      setlocal softtabstop=3
+      setlocal shiftwidth=3
+   endif
 endif
 
 " Section: Abbrev {{{1
index 60b11dab1a78b715e0c5929329f9c3d1dce65d05..994bbb58c6af8169ae26feca8436f5b2b154c93b 100644 (file)
@@ -4,6 +4,7 @@
 "              Ken Takata <https://github.com/k-takata>
 " Last Change: 2024 Apr 12
 "              2024 Jun 02 by Riley Bruins <ribru17@gmail.com> ('commentstring')
+"              2026 Jun 27 by Vim Project (normalize recommended style guard)
 "
 " Most of the part was copied from c.vim.
 
@@ -21,7 +22,8 @@ set cpo-=C
 
 let b:undo_ftplugin = "setl fo< com< ofu< cms< def< inc<"
 
-if !exists("g:arduino_recommended_style") || g:arduino_recommended_style != 0
+if get(g:, 'arduino_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
   " Use the default setting of Arduino IDE.
   setlocal expandtab tabstop=2 softtabstop=2 shiftwidth=2
   let b:undo_ftplugin ..= " et< ts< sts< sw<"
index 91b9298930321a9bcc365a95c583651bfee23f39..5b696fceeaa5f40417289e27a85f1fd8d8635702 100644 (file)
@@ -4,13 +4,17 @@
 " Last Change: 2024 Jul 06
 " 2026 Jan 13 by Vim project: set compiler #19152
 " 2026 Jun 26 by Vim project: set expandtab #20623
+" 2026 Jun 27 by Vim Project: add recommended style guard
 
 if exists('b:did_ftplugin')
   finish
 endif
 let b:did_ftplugin = 1
 
-setlocal expandtab
+if get(g:, 'cabal_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal expandtab
+endif
 setlocal comments=:-- commentstring=--\ %s
 
 compiler cabal
index 5e52702fd5eac91a74d3af63a1f47ef83c98c6fc..a8c0d2975db739c0a55ed83577cecad77cc01e3e 100644 (file)
@@ -4,6 +4,7 @@
 "     (formerly Tim Pope <vimNOSPAM@tpope.info>)
 " Last Update: By Ankit Jain (add gtk support) on 15.08.2020
 "              2024 Jan 14 by Vim Project (browsefilter)
+"              2026 Jun 27 by Vim Project (add recommended style guard)
 
 " Insert mode mappings: <C-T> <C-D> <Tab>
 " Normal mode mappings: < > << >> [[ ]] [] ][
@@ -20,8 +21,11 @@ set cpo&vim
 setlocal commentstring=\ \ \ \ \ \ *%s
 setlocal comments=:*
 setlocal fo+=croqlt
-setlocal expandtab
-setlocal textwidth=72
+if get(g:, 'cobol_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal expandtab
+  setlocal textwidth=72
+endif
 
 " matchit support
 if exists("loaded_matchit")
index d067f472b7ec954cec4ae8da3e0813213a8c85ea..ba92c11ac7678c64193b0a0549e63752b23879eb 100644 (file)
@@ -2,6 +2,7 @@
 " Language: Elixir
 " Maintainer:  Mitchell Hanberg <vimNOSPAM@mitchellhanberg.com>
 " Last Change: 2023 Dec 27
+"              2026 Jun 27 by Vim Project (add recommended style guard)
 
 if exists("b:did_ftplugin")
   finish
@@ -23,7 +24,11 @@ if exists('loaded_matchit') && !exists('b:match_words')
         \ ',{:},\[:\],(:)'
 endif
 
-setlocal shiftwidth=2 softtabstop=2 expandtab iskeyword+=!,?
+if get(g:, 'elixir_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal shiftwidth=2 softtabstop=2 expandtab
+endif
+setlocal iskeyword+=!,?
 setlocal comments=:#
 setlocal commentstring=#\ %s
 
index 1000b62e76387c885c74203a7bf1c054dee36ff6..d1357786472f5e83b4588a69b0c4a673b42a95bc 100644 (file)
@@ -5,6 +5,7 @@
 " License:      You may redistribute this under the same terms as Vim itself
 " Last Update:  2020 Oct 10
 "               2024 Jan 14 by Vim Project (browsefilter)
+"               2026 Jun 27 by Vim Project (add recommended style guard)
 " --------------------------------------------------------------------------
 
 " Only do this when not done yet for this buffer
@@ -16,7 +17,10 @@ let b:did_ftplugin = 1
 let s:cpo_save = &cpo
 set cpo&vim
 
-setlocal softtabstop=4 shiftwidth=4
+if get(g:, 'falcon_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal softtabstop=4 shiftwidth=4
+endif
 setlocal suffixesadd=.fal,.ftd
 
 " Matchit support
index d1f41c8eafc264f9b8ff3e821cefcde281d08a29..b52dd00272552e09550ff93e5547a819875fe2f6 100644 (file)
@@ -5,6 +5,7 @@ vim9script
 # Maintainer: Maxim Kim <habamax@gmail.com>
 # Website: https://github.com/habamax/vim-gdscript
 # Last Change: 2024 Jul 14
+#              2026 Jun 27 by Vim Project (normalize recommended style guard)
 
 if exists("b:did_ftplugin") | finish | endif
 
@@ -23,7 +24,7 @@ setlocal commentstring=#\ %s
 setlocal foldignore=
 setlocal foldexpr=GDScriptFoldLevel()
 
-if get(g:, 'gdscript_recommended_style', 1)
+if get(g:, 'gdscript_recommended_style', get(g:, 'filetype_recommended_style', 1))
     setlocal noexpandtab tabstop=4 softtabstop=0 shiftwidth=0
     b:undo_ftplugin ..= ' | setlocal expandtab< tabstop< softtabstop< shiftwidth<'
 endif
index fb3ae8bb3487a744ae1bf9c48a3f7db48a0111ad..c89665acbb6a3cea871f0e9141530524a3438985 100644 (file)
@@ -5,6 +5,7 @@
 " Based On:            https://github.com/gleam-lang/gleam.vim
 " Last Change:         2025 Apr 21
 "                      2026 Feb 13 by Vim Project (remove 'formatprg' #19108)
+"                      2026 Jun 27 by Vim Project (normalize recommended style guard)
 
 if exists('b:did_ftplugin')
   finish
@@ -16,7 +17,8 @@ setlocal commentstring=//\ %s
 setlocal suffixesadd=.gleam
 let b:undo_ftplugin = "setlocal com< cms< sua<"
 
-if get(g:, "gleam_recommended_style", 1)
+if get(g:, 'gleam_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
   setlocal expandtab
   setlocal shiftwidth=2
   setlocal smartindent
index 6559ad1011f0d24de316840b980bce1dc3540446..606e75771ece658f7be4c643de1448cc61d02291 100644 (file)
@@ -9,6 +9,7 @@
 " 2025 Jul 02 by Vim Project (add section movement mappings #17641)
 " 2025 Jul 05 by Vim Project (update b:undo_ftplugin #17664)
 " 2026 Feb 13 by Vim Project (remove formatprg #19108)
+" 2026 Jun 27 by Vim Project (normalize recommended style guard)
 
 if exists('b:did_ftplugin')
   finish
@@ -29,7 +30,8 @@ command! -buffer -nargs=* GoKeywordPrg call s:GoKeywordPrg()
 let b:undo_ftplugin = 'setl fo< com< cms< kp<'
                   \ . '| delcommand -buffer GoKeywordPrg'
 
-if get(g:, 'go_recommended_style', 1)
+if get(g:, 'go_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
   setlocal noexpandtab softtabstop=0 shiftwidth=0
   let b:undo_ftplugin .= ' | setl et< sts< sw<'
 endif
index 1717ebf2ccc7ed21b19dca1d3ab54e6cfa51b2d1..c5ed37b5a40d866be901e2e18ac2b208343f038e 100644 (file)
@@ -5,6 +5,7 @@
 " URL:         https://github.com/jparise/vim-graphql
 " License:     MIT <https://opensource.org/license/mit>
 " Last Change: 2024 Dec 21
+"              2026 Jun 27 by Vim Project (add recommended style guard)
 
 if exists('b:did_ftplugin')
   finish
@@ -15,8 +16,11 @@ setlocal comments=:#
 setlocal commentstring=#\ %s
 setlocal formatoptions-=t
 setlocal iskeyword+=$,@-@
-setlocal softtabstop=2
-setlocal shiftwidth=2
-setlocal expandtab
+if get(g:, 'graphql_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal softtabstop=2
+  setlocal shiftwidth=2
+  setlocal expandtab
+endif
 
 let b:undo_ftplugin = 'setlocal com< cms< fo< isk< sts< sw< et<'
index ebd7fbdcc302543b9b6e44ad4c2f7f0767f9a948..1d162d6ad8fb96434b88fcba82d0476ff7f55eea 100644 (file)
@@ -4,6 +4,7 @@ vim9script
 # Language:    Hare
 # Maintainer:  Amelia Clarke <selene@perilune.dev>
 # Last Change: 2026 Jan 24
+#              2026 Jun 27 by Vim Project (normalize recommended style guard)
 # Upstream:    https://git.sr.ht/~sircmpwn/hare.vim
 
 if exists('b:did_ftplugin')
@@ -30,7 +31,7 @@ setlocal isfname+=:
 b:undo_ftplugin ..= ' | setl inc< inex< isf< pa<'
 
 # Follow the official style guide by default.
-if get(g:, 'hare_recommended_style', 1)
+if get(g:, 'hare_recommended_style', get(g:, 'filetype_recommended_style', 1))
   setlocal noexpandtab
   setlocal shiftwidth=8
   setlocal softtabstop=0
index 04cabfb4b5eb249224aaac9ec89a506fbd088ad3..1ab7e947dd3b46beec081e29aa3ba8940b95fc3e 100644 (file)
@@ -4,6 +4,7 @@ vim9script
 # Language:    Haredoc (Hare documentation format)
 # Maintainer:  Amelia Clarke <selene@perilune.dev>
 # Last Change: 2026 Jan 24
+#              2026 Jun 27 by Vim Project (normalize recommended style guard)
 # Upstream:    https://git.sr.ht/~sircmpwn/hare.vim
 
 if exists('b:did_ftplugin')
@@ -29,7 +30,7 @@ setlocal isfname+=:
 b:undo_ftplugin ..= ' | setl inex< isf< pa<'
 
 # Follow the official style guide by default.
-if get(g:, 'hare_recommended_style', 1)
+if get(g:, 'hare_recommended_style', get(g:, 'filetype_recommended_style', 1))
   setlocal noexpandtab
   setlocal shiftwidth=8
   setlocal softtabstop=0
index 2f53d22ee6a83a34723d9a01534cd26548d6faaa..2bb8eaa9eedacf598c2bbf0f8106c42bfb457748 100644 (file)
@@ -3,6 +3,7 @@
 " Maintainer:  Mitchell Hanberg <vimNOSPAM@mitchellhanberg.com>
 " Last Change: 2022 Sep 21
 " 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
+" 2026 Jun 27 by Vim Project (add recommended style guard)
 
 if exists("b:did_ftplugin")
   finish
@@ -12,7 +13,10 @@ let b:did_ftplugin = 1
 let s:cpo_save = &cpo
 set cpo&vim
 
-setlocal shiftwidth=2 softtabstop=2 expandtab
+if get(g:, 'heex_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal shiftwidth=2 softtabstop=2 expandtab
+endif
 
 setlocal comments=:<%!--
 setlocal commentstring=<%!--\ %s\ --%>
index 54e5acef9010855e6019729122ae095322c37172..1638b32fb6657ea82e0c845719c178bb121816de 100644 (file)
@@ -1,6 +1,7 @@
 " Vim ftplugin file
 " Language:       Idris 2
 " Last Change: 2024 Nov 05
+"              2026 Jun 27 by Vim Project (add recommended style guard)
 " Maintainer:  Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma <srghma@gmail.com>
 " License:     Vim (see :h license)
 " Repository:  https://github.com/ShinKage/idris2-nvim
@@ -11,8 +12,11 @@ if exists("b:did_ftplugin")
   finish
 endif
 
-setlocal shiftwidth=2
-setlocal tabstop=2
+if get(g:, 'idris2_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal shiftwidth=2
+  setlocal tabstop=2
+endif
 
 " Set g:idris2#allow_tabchar = 1 to use tabs instead of spaces
 if exists('g:idris2#allow_tabchar') && g:idris2#allow_tabchar != 0
index d4ee5ac24231b7db50466da11c0d35cdd1c44b58..c8f9d57fd5ff94ed5995b743c7573d3ba7950f1f 100644 (file)
@@ -3,6 +3,7 @@
 " Maintainer:   Tim Pope <https://github.com/tpope/vim-markdown>
 " Last Change:  2023 Dec 28
 "               2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring')
+"               2026 Jun 27 by Vim Project (normalize recommended style guard)
 
 if exists("b:did_ftplugin")
   finish
@@ -23,7 +24,8 @@ else
   let b:undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<"
 endif
 
-if get(g:, 'markdown_recommended_style', 1)
+if get(g:, 'markdown_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
   setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4
 endif
 
index 5547ad3e1fe71e2638d165dcd414201a3d9a936c..a9ac9d521e4a20515c32a8c147210172dc61de07 100644 (file)
@@ -3,6 +3,7 @@
 " Maintainer:   Craig MacEachern <https://github.com/craigmac/vim-mermaid>
 " Last Change:  2022 Oct 13
 " 2024 Jul 18 by Vim Project (adjust comments)
+" 2026 Jun 27 by Vim Project (add recommended style guard)
 
 if exists("b:did_ftplugin")
   finish
@@ -12,10 +13,13 @@ let s:keepcpo= &cpo
 set cpo&vim
 
 " Use mermaid live editor's style
-setlocal expandtab
-setlocal shiftwidth=2
-setlocal softtabstop=-1
-setlocal tabstop=4
+if get(g:, 'mermaid_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal expandtab
+  setlocal shiftwidth=2
+  setlocal softtabstop=-1
+  setlocal tabstop=4
+endif
 
 setlocal comments=:%%
 setlocal commentstring=%%\ %s
index 17ffd5320a662c3e358994e7e7e10aaf3029719e..6f700a8d6a454ca163477760408e3083a73304da 100644 (file)
@@ -5,6 +5,7 @@
 " Original Author:     Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 " Last Change:         2018 Nov 27
 "                      2024 Jan 14 by Vim Project (browsefilter)
+"                      2026 Jun 27 by Vim Project (normalize recommended style guard)
 
 if exists("b:did_ftplugin") | finish | endif
 let b:did_ftplugin = 1
@@ -17,7 +18,8 @@ setlocal formatoptions+=croql formatoptions-=t
 
 let b:undo_ftplugin = "setl com< cms< fo<"
 
-if get(g:, "meson_recommended_style", 1)
+if get(g:, 'meson_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
   setlocal expandtab
   setlocal shiftwidth=2
   setlocal softtabstop=2
index 1404c0ea338ec0f625a5b61e3cc49f2eba228a6e..b4dfaa1c45f17637b724b7b51635393b0b08e8d3 100644 (file)
@@ -5,6 +5,7 @@
 " Last Change: 23 April 2003
 " 2024 Jan 14 by Vim Project (browsefilter)
 " 2025 Jun 08 by Riley Bruins <ribru17@gmail.com> ('commentstring')
+" 2026 Jun 27 by Vim Project (add recommended style guard)
 
 " Only do this when not done yet for this buffer
 if exists("b:did_ftplugin")
@@ -15,12 +16,15 @@ let s:keepcpo= &cpo
 set cpo&vim
 
 "{{{  Indent settings
-" Set shift width for indent
-setlocal shiftwidth=2
-" Set the tab key size to two spaces
-setlocal softtabstop=2
-" Let tab keys always be expanded to spaces
-setlocal expandtab
+if get(g:, 'occam_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  " Set shift width for indent
+  setlocal shiftwidth=2
+  " Set the tab key size to two spaces
+  setlocal softtabstop=2
+  " Let tab keys always be expanded to spaces
+  setlocal expandtab
+endif
 "}}}
 
 "{{{  Formatting
@@ -28,8 +32,11 @@ setlocal expandtab
 setlocal formatoptions-=t formatoptions+=cql
 setlocal comments+=:--
 setlocal commentstring=--\ %s
-" Maximum length of comments is 78
-setlocal textwidth=78
+if get(g:, 'occam_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  " Maximum length of comments is 78
+  setlocal textwidth=78
+endif
 "}}}
 
 "{{{  File browsing filters
index 6f204688966ad6717f07f93b249eda754ff54c9a..50d86537d96291e10322703da15d7abd5325a685 100644 (file)
@@ -6,6 +6,7 @@
 " Repository: https://github.com/tpict/vim-ftplugin-python
 " Last Change: 2024/05/13
 "              2024 Nov 30 use pytest compiler (#16130)
+"              2026 Jun 27 by Vim Project (normalize recommended style guard)
 
 if exists("b:did_ftplugin") | finish | endif
 let b:did_ftplugin = 1
@@ -119,7 +120,8 @@ if has("browsefilter") && !exists("b:browsefilter")
     endif
 endif
 
-if !exists("g:python_recommended_style") || g:python_recommended_style != 0
+if get(g:, 'python_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
     " As suggested by PEP8.
     setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4
 endif
index 000f0ea3b3587f02cdfd4a27633b0d0387cd6445..70e0ccdc3f6b739367778b1d201d5d5969fa17d5 100644 (file)
@@ -6,6 +6,7 @@
 " Last Change:          2025 Aug 09
 " 2026 Mar 31 by Vim project: use shellescape for the K mapping
 " 2026 Apr 01 by Vim project: make K mapping more robust for shell injection
+" 2026 Jun 27 by Vim Project: add recommended style guard
 
 if exists("b:did_ftplugin")
   finish
@@ -18,7 +19,10 @@ set cpo&vim
 " quick hack to allow adding values
 setlocal iskeyword=@,!,#-',*-:,<-Z,a-z,~,_,94
 
-setlocal shiftwidth=2 softtabstop=2
+if get(g:, 'racket_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal shiftwidth=2 softtabstop=2
+endif
 
 " Enable auto begin new comment line when continuing from an old comment line
 setlocal comments=:;;;;,:;;;,:;;,:;
index ab0a32576c3652eb0992b93666e89d67dbd767ad..8a63dce1e01068d32429702760b463288e3ac157 100644 (file)
@@ -4,6 +4,7 @@
 " URL:                 https://github.com/vim-ruby/vim-ruby
 " Last Change:         2023 Dec 31
 "                      2024 Jan 14 by Vim Project (browsefilter)
+"                      2026 Jun 27 by Vim Project (normalize recommended style guard)
 
 if (exists("b:did_ftplugin"))
   finish
@@ -160,7 +161,8 @@ let b:undo_ftplugin = "setl inc= sua= path= tags= fo< com< cms< kp="
       \."| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip"
       \."| if exists('&ofu') && has('ruby') | setl ofu< | endif"
 
-if get(g:, 'ruby_recommended_style', 1)
+if get(g:, 'ruby_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
   setlocal shiftwidth=2 softtabstop=2 expandtab
   let b:undo_ftplugin .= ' | setl sw< sts< et<'
 endif
index 4765f81704b2a677482b523d41074d511a437e59..38c33fd5b2f64d2d74dda43c5c5043692fe429e5 100644 (file)
@@ -4,6 +4,7 @@
 " Last Change: 2024 Mar 17
 "              2024 May 23 by Riley Bruins <ribru17@gmail.com ('commentstring')
 "              2025 Dec 09 update 'textwidth# to 100 #18892
+"              2026 Jun 27 by Vim Project normalize recommended style guard
 " For bugs, patches and license go to https://github.com/rust-lang/rust.vim
 
 if exists("b:did_ftplugin")
@@ -47,7 +48,8 @@ silent! setlocal formatoptions+=j
 " otherwise it's better than nothing.
 setlocal smartindent nocindent
 
-if get(g:, 'rust_recommended_style', 1)
+if get(g:, 'rust_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
     let b:rust_set_style = 1
     setlocal shiftwidth=4 softtabstop=4 expandtab
     setlocal textwidth=100
index e650be93129bde2989b9a84e75b91d9bfad57f5e..9e10cbe880ab81539012634d56f5966cfe8f2b63 100644 (file)
@@ -2,6 +2,7 @@
 " Language:    Sass
 " Maintainer:  Tim Pope <vimNOSPAM@tpope.org>
 " Last Change: 2023 Dec 28
+"              2026 Jun 27 by Vim Project normalize recommended style guard
 
 " Only do this when not done yet for this buffer
 if exists("b:did_ftplugin")
@@ -23,7 +24,8 @@ if &filetype =~# '\<s[ac]ss]\>'
   let b:undo_ftplugin .= ' isk<'
 endif
 
-if get(g:, 'sass_recommended_style', 1)
+if get(g:, 'sass_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
   setlocal shiftwidth=2 softtabstop=2 expandtab
   let b:undo_ftplugin .= ' sw< sts< et<'
 endif
index 769499cfc18d78ebc5ebddfe49c026251df3ac06..0720b8849b2898750d5502afeb3d45c48eddd324 100644 (file)
@@ -5,6 +5,7 @@
 " License:              Same as Vim
 " Last Change:          11 August 2021
 "                       2023 Aug 28 by Vim Project (undo_ftplugin)
+"                       2026 Jun 27 by Vim Project (add recommended style guard)
 " ----------------------------------------------------------------------------
 
 if exists('b:did_ftplugin') || &cp
@@ -25,7 +26,10 @@ else
 endif
 setlocal commentstring=//\ %s
 
-setlocal shiftwidth=2 softtabstop=2 expandtab
+if get(g:, 'scala_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal shiftwidth=2 softtabstop=2 expandtab
+endif
 
 setlocal include=^\\s*import
 setlocal includeexpr=substitute(v:fname,'\\.','/','g')
index a86b782c22736b0457f64c051726fbb836626e75..0bf72f23ab8290c92ae058cfd168c209057f2b05 100644 (file)
@@ -8,6 +8,7 @@
 "
 " Vim maintainer:      Emir SARI <bitigchi@me.com>
 " Last Change:         2021 Jan 08
+"                      2026 Jun 27 by Vim Project (add recommended style guard)
 
 " Only do this when not done yet for this buffer
 if exists("b:did_ftplugin")
@@ -18,6 +19,9 @@ let b:did_ftplugin = 1
 let b:undo_ftplugin = "setlocal comments< expandtab< tabstop< shiftwidth< smartindent<"
 
 setlocal comments=s1:/*,mb:*,ex:*/,:///,://
-setlocal expandtab
-setlocal sw=4 sts=4
+if get(g:, 'swift_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal expandtab
+  setlocal sw=4 sts=4
+endif
 setlocal smartindent
index ce4134ae03696df01e106ca4a6853b7e5a28ad90..a1ea7e5a3224f4429bbf154e8a056d84ed2640cc 100644 (file)
@@ -3,6 +3,7 @@
 " Maintainer:           Muntasir Mahmud <muntasir.joypurhat@gmail.com>
 " Last Change:          2025 Mar 08
 " 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121)
+" 2026 Jun 27 by Vim Project (add recommended style guard)
 
 if exists("b:did_ftplugin")
   finish
@@ -25,9 +26,12 @@ endif
 setlocal includeexpr=substitute(v:fname,'\\([^.]*\\)$','\\1','g')
 setlocal suffixesadd=.tera
 
-setlocal expandtab
-setlocal shiftwidth=2
-setlocal softtabstop=2
+if get(g:, 'tera_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
+  setlocal expandtab
+  setlocal shiftwidth=2
+  setlocal softtabstop=2
+endif
 
 let b:undo_ftplugin = "setlocal autoindent< commentstring< comments< " ..
       \ "includeexpr< suffixesadd< expandtab< shiftwidth< softtabstop<"
index f1339b7b6ce7731044fe161b6ce3fca4e8af03ba..fa184350b0765edd9393f86cc729ffb14a36d231 100644 (file)
@@ -3,6 +3,7 @@
 " Maintainer:   redavy <hello.redavy@proton.me>
 " Upstream:     https://github.com/redavy/vim-tolk
 " Last Update:  24 May 2026
+"               27 Jun 2026 by Vim Project (normalize recommended style guard)
 
 if exists("b:did_ftplugin")
   finish
@@ -11,7 +12,8 @@ let b:did_ftplugin = 1
 
 setlocal commentstring=//\ %s
 
-if get(g:, 'tolk_recommended_style', get(g:, 'recommended_style', 1))
+if get(g:, 'tolk_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
   setlocal tabstop=2
   setlocal shiftwidth=2
   setlocal expandtab
index 12036a86aacb0d1247694443f5e22869c4f2a55b..bb8cb844750f5e45a82cb49dc753112331e8e4b2 100644 (file)
@@ -3,6 +3,7 @@
 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se> (inactive)
 " Last Change:          2024 Oct 04
 " 2025 Apr 22 by Vim project re-order b:undo_ftplugin (#17179)
+" 2026 Jun 27 by Vim Project normalize recommended style guard
 
 if exists("b:did_ftplugin")
   finish
@@ -17,7 +18,8 @@ let b:undo_ftplugin = "setl com< cms< et< fo<"
 setlocal comments=:# commentstring=#\ %s expandtab
 setlocal formatoptions-=t formatoptions+=croql
 
-if get(g:, "yaml_recommended_style",1)
+if get(g:, 'yaml_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
   let b:undo_ftplugin ..= " sw< sts<"
   setlocal shiftwidth=2 softtabstop=2
 endif
index 55c3008c8fe7e3f766f48e1bbbca33c57c47b1d7..682abb56f34c836441c82843edc0d084c9ae16be 100644 (file)
@@ -2,6 +2,7 @@
 " Language:     Zig
 " Maintainer:   Mathias Lindgren <math.lindgren@gmail.com>
 " Last Change:  2024 Oct 04
+"               2026 Jun 27 by Vim Project (normalize recommended style guard)
 " Based on:     https://codeberg.org/ziglang/zig.vim
 
 if exists("b:did_ftplugin")
@@ -20,7 +21,8 @@ setlocal suffixesadd=.zig,.zir,.zon
 let &l:define='\v(<fn>|<const>|<var>|^\s*\#\s*define)'
 let b:undo_ftplugin = 'setl isk< fo< sua< mp< def<'
 
-if get(g:, 'zig_recommended_style', 1)
+if get(g:, 'zig_recommended_style',
+      \ get(g:, 'filetype_recommended_style', 1))
     setlocal expandtab
     setlocal tabstop=8
     setlocal softtabstop=4