vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

yaml.vim (1203B)


      1 " Vim filetype plugin file
      2 " Language:             YAML (YAML Ain't Markup Language)
      3 " Previous Maintainer:  Nikolai Weibull <now@bitwi.se> (inactive)
      4 " Last Change:          2024 Oct 04
      5 " 2025 Apr 22 by Vim project re-order b:undo_ftplugin (#17179)
      6 " 2026 Jun 27 by Vim Project normalize recommended style guard
      7 
      8 if exists("b:did_ftplugin")
      9   finish
     10 endif
     11 let b:did_ftplugin = 1
     12 
     13 let s:cpo_save = &cpo
     14 set cpo&vim
     15 
     16 let b:undo_ftplugin = "setl com< cms< et< fo<"
     17 
     18 setlocal comments=:# commentstring=#\ %s expandtab
     19 setlocal formatoptions-=t formatoptions+=croql
     20 
     21 if get(g:, 'yaml_recommended_style',
     22       \ get(g:, 'filetype_recommended_style', 1))
     23   let b:undo_ftplugin ..= " sw< sts<"
     24   setlocal shiftwidth=2 softtabstop=2
     25 endif
     26 
     27 " rime input method engine(https://rime.im/)
     28 " uses `*.custom.yaml` as its config files
     29 if expand('%:r:e') ==# 'custom'
     30   " `__include` command in `*.custom.yaml`
     31   " see: https://github.com/rime/home/wiki/Configuration#%E5%8C%85%E5%90%AB
     32   setlocal include=__include:\\s*
     33   let b:undo_ftplugin ..= " inc<"
     34 
     35   if !exists('current_compiler')
     36     compiler rime_deployer
     37     let b:undo_ftplugin ..= " | compiler make"
     38   endif
     39 endif
     40 
     41 
     42 let &cpo = s:cpo_save
     43 unlet s:cpo_save