blob: 3ea68fa0a7c1ca38715dbf706f32ac72f64d0526 [file] [log] [blame]
Trilowy6e918532024-10-13 19:08:30 +02001" Vim filetype plugin file
Kirill Morozov3cbd7f12025-04-13 17:58:32 +02002" Language: Gleam
3" Maintainer: Kirill Morozov <kirill@robotix.pro>
4" Previous Maintainer: Trilowy (https://github.com/trilowy)
Kirill Morozov32f49732025-04-24 21:28:56 +02005" Based On: https://github.com/gleam-lang/gleam.vim
6" Last Change: 2025 Apr 21
Trilowy6e918532024-10-13 19:08:30 +02007
8if exists('b:did_ftplugin')
9 finish
10endif
11let b:did_ftplugin = 1
12
Kirill Morozov32f49732025-04-24 21:28:56 +020013setlocal comments=:////,:///,://
Trilowy6e918532024-10-13 19:08:30 +020014setlocal commentstring=//\ %s
Kirill Morozov3cbd7f12025-04-13 17:58:32 +020015setlocal formatprg=gleam\ format\ --stdin
Kirill Morozov32f49732025-04-24 21:28:56 +020016setlocal suffixesadd=.gleam
17let b:undo_ftplugin = "setlocal com< cms< fp< sua<"
Doug Kearns40daa132025-04-16 18:29:15 +020018
19if get(g:, "gleam_recommended_style", 1)
20 setlocal expandtab
21 setlocal shiftwidth=2
Kirill Morozov32f49732025-04-24 21:28:56 +020022 setlocal smartindent
Doug Kearns40daa132025-04-16 18:29:15 +020023 setlocal softtabstop=2
Kirill Morozov32f49732025-04-24 21:28:56 +020024 setlocal tabstop=2
25 let b:undo_ftplugin ..= " | setlocal et< sw< si< sts< ts<"
26endif
27
28if !exists('current_compiler')
29 compiler gleam_build
30 let b:undo_ftplugin ..= "| compiler make"
Doug Kearns40daa132025-04-16 18:29:15 +020031endif
Trilowy6e918532024-10-13 19:08:30 +020032
33" vim: sw=2 sts=2 et