neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 5aa35691ab737296909da36c941494bbc5e57929
parent 95a255a548401e1fbcca2934ceed040305046d11
Author: Christian Clason <c.clason@uni-graz.at>
Date:   Wed, 16 Apr 2025 20:04:34 +0200

vim-patch:40daa13: runtime(gleam): Update ftplugin, use recommended_style config variable

Wrap the setting of basic whitespace formatting options in a conditional
block, following the de facto standard.

Setting 'et', 'sts' and 'sw' can be disabled by setting
"gleam_recommended_style" to false.

Follow up to PR vim/vim#17086.

closes: vim/vim#17128

https://github.com/vim/vim/commit/40daa1358cf46cd155b733ffb1e5a3f9f591dedb

Co-authored-by: Doug Kearns <dougkearns@gmail.com>

Diffstat:
Mruntime/doc/filetype.txt | 10++++++++++
Mruntime/ftplugin/gleam.vim | 14+++++++++-----
2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt @@ -625,6 +625,16 @@ possibilities: > The `:Cycle` command is also mapped to the CTRL-A and CTRL-X keys. For details, see `git-rebase --help`. +GLEAM *ft-gleam-plugin* + +By default the following options are set for the recommended gleam style: > + + setlocal expandtab shiftwidth=2 softtabstop=2 + +To disable this behavior, set the following variable in your vimrc: > + + let g:gleam_recommended_style = 0 + GO *ft-go-plugin* By default the following options are set, based on Golang official docs: > diff --git a/runtime/ftplugin/gleam.vim b/runtime/ftplugin/gleam.vim @@ -2,7 +2,7 @@ " Language: Gleam " Maintainer: Kirill Morozov <kirill@robotix.pro> " Previous Maintainer: Trilowy (https://github.com/trilowy) -" Last Change: 2025-04-12 +" Last Change: 2025 Apr 16 if exists('b:did_ftplugin') finish @@ -11,11 +11,15 @@ let b:did_ftplugin = 1 setlocal comments=://,:///,://// setlocal commentstring=//\ %s -setlocal expandtab setlocal formatprg=gleam\ format\ --stdin -setlocal shiftwidth=2 -setlocal softtabstop=2 -let b:undo_ftplugin = "setlocal com< cms< fp< et< sw< sts<" +let b:undo_ftplugin = "setlocal com< cms< fp<" + +if get(g:, "gleam_recommended_style", 1) + setlocal expandtab + setlocal shiftwidth=2 + setlocal softtabstop=2 + let b:undo_ftplugin ..= " | setlocal et< sw< sts<" +endif " vim: sw=2 sts=2 et