Files
neovim/runtime/ftplugin/haredoc.vim
zeertzjq 07c37f6645 vim-patch:1f33732: runtime: guard recommended style settings consistently
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>
2026-06-29 08:47:54 +08:00

46 lines
1.2 KiB
VimL

" Vim filetype plugin.
" Language: Haredoc (Hare documentation format)
" Maintainer: Amelia Clarke <selene@perilune.dev>
" Last Updated: 2024-05-02
" 2026 Jun 27 by Vim Project (normalize recommended style guard)
" Upstream: https://git.sr.ht/~selene/hare.vim
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
" Formatting settings.
setlocal comments=:\
setlocal formatlistpat=^\ \\?-\
setlocal formatoptions+=tnlj formatoptions-=c formatoptions-=q
" Search for Hare modules.
setlocal includeexpr=hare#FindModule(v:fname)
setlocal isfname+=:
setlocal suffixesadd=.ha
" Add HAREPATH to the default search paths.
setlocal path-=/usr/include,,
let &l:path .= ',' .. hare#GetPath() .. ',,'
let b:undo_ftplugin = 'setl com< flp< fo< inex< isf< pa< sua<'
" Follow the Hare style guide by default.
if get(g:, 'hare_recommended_style', get(g:, 'filetype_recommended_style', 1))
setlocal noexpandtab
setlocal shiftwidth=0
setlocal softtabstop=0
setlocal tabstop=8
setlocal textwidth=80
let b:undo_ftplugin .= ' et< sts< sw< ts< tw<'
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: et sts=2 sw=2 ts=8