blob: 12036a86aacb0d1247694443f5e22869c4f2a55b [file] [log] [blame]
Bram Moolenaar42eeac32005-06-29 22:40:58 +00001" Vim filetype plugin file
Bram Moolenaar214641f2017-03-05 17:04:09 +01002" Language: YAML (YAML Ain't Markup Language)
Bram Moolenaarb17893a2020-03-14 08:19:51 +01003" Previous Maintainer: Nikolai Weibull <now@bitwi.se> (inactive)
Vincent Law229f79c2025-04-22 20:35:11 +02004" Last Change: 2024 Oct 04
5" 2025 Apr 22 by Vim project re-order b:undo_ftplugin (#17179)
Bram Moolenaar42eeac32005-06-29 22:40:58 +00006
7if exists("b:did_ftplugin")
8 finish
9endif
10let b:did_ftplugin = 1
11
Bram Moolenaare37d50a2008-08-06 17:06:04 +000012let s:cpo_save = &cpo
13set cpo&vim
14
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000015let b:undo_ftplugin = "setl com< cms< et< fo<"
Bram Moolenaar42eeac32005-06-29 22:40:58 +000016
17setlocal comments=:# commentstring=#\ %s expandtab
Bram Moolenaar0dc065e2005-07-04 22:49:24 +000018setlocal formatoptions-=t formatoptions+=croql
Bram Moolenaare37d50a2008-08-06 17:06:04 +000019
Vincent Law229f79c2025-04-22 20:35:11 +020020if get(g:, "yaml_recommended_style",1)
Bram Moolenaarb17893a2020-03-14 08:19:51 +010021 let b:undo_ftplugin ..= " sw< sts<"
22 setlocal shiftwidth=2 softtabstop=2
23endif
24
Vincent Law229f79c2025-04-22 20:35:11 +020025" rime input method engine(https://rime.im/)
26" uses `*.custom.yaml` as its config files
27if expand('%:r:e') ==# 'custom'
28 " `__include` command in `*.custom.yaml`
29 " see: https://github.com/rime/home/wiki/Configuration#%E5%8C%85%E5%90%AB
30 setlocal include=__include:\\s*
31 let b:undo_ftplugin ..= " inc<"
32
33 if !exists('current_compiler')
34 compiler rime_deployer
35 let b:undo_ftplugin ..= " | compiler make"
36 endif
37endif
38
39
Bram Moolenaare37d50a2008-08-06 17:06:04 +000040let &cpo = s:cpo_save
41unlet s:cpo_save