mirror of
https://github.com/neovim/neovim.git
synced 2026-07-23 01:12:49 +00:00
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: vim/vim#20036
closes: vim/vim#20650
1f33732613
Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
43 lines
1.4 KiB
VimL
43 lines
1.4 KiB
VimL
" Vim filetype plugin file
|
|
" Language: Scala
|
|
" Maintainer: Derek Wyatt
|
|
" URL: https://github.com/derekwyatt/vim-scala
|
|
" 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
|
|
finish
|
|
endif
|
|
let b:did_ftplugin = 1
|
|
|
|
" j is fairly new in Vim, so don't complain if it's not there
|
|
setlocal formatoptions-=t formatoptions+=croqnl
|
|
silent! setlocal formatoptions+=j
|
|
|
|
" Just like c.vim, but additionally doesn't wrap text onto /** line when
|
|
" formatting. Doesn't bungle bulleted lists when formatting.
|
|
if get(g:, 'scala_scaladoc_indent', 0)
|
|
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s2:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
|
|
else
|
|
setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/**,mb:*,ex:*/,s1:/*,mb:*,ex:*/,://
|
|
endif
|
|
setlocal commentstring=//\ %s
|
|
|
|
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')
|
|
|
|
setlocal path+=src/main/scala,src/test/scala
|
|
setlocal suffixesadd=.scala
|
|
|
|
let b:undo_ftplugin = "setlocal cms< com< et< fo< inc< inex< pa< sts< sua< sw<"
|
|
|
|
" vim:set sw=2 sts=2 ts=8 et:
|