mirror of
https://github.com/neovim/neovim.git
synced 2026-07-22 17:02:59 +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>
39 lines
1.1 KiB
VimL
39 lines
1.1 KiB
VimL
" 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
|
|
"
|
|
" Based on ftplugin/idris2.vim from https://github.com/edwinb/idris2-vim
|
|
|
|
if exists("b:did_ftplugin")
|
|
finish
|
|
endif
|
|
|
|
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
|
|
setlocal noexpandtab
|
|
else
|
|
setlocal expandtab
|
|
endif
|
|
|
|
setlocal comments=s1:{-,mb:-,ex:-},:\|\|\|,:--
|
|
setlocal commentstring=--\ %s
|
|
|
|
" makes ? a part of a word, e.g. for named holes `vzipWith f [] [] = ?vzipWith_rhs_3`, uncomment if want to reenable
|
|
" setlocal iskeyword+=?
|
|
|
|
setlocal wildignore+=*.ibc
|
|
|
|
let b:undo_ftplugin = "setlocal shiftwidth< tabstop< expandtab< comments< commentstring< iskeyword< wildignore<"
|
|
|
|
let b:did_ftplugin = 1
|