mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
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
40daa1358c
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:

committed by
Christian Clason

parent
95a255a548
commit
5aa35691ab
@@ -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: >
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user