robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
cbf54ec2a5
master
1" Vim support file to switch on loading indent files for file types 2" 3" Maintainer: The Vim Project <https://github.com/vim/vim> 4" Last Change: 2023 Aug 10 5" Former Maintainer: Bram Moolenaar <Bram@vim.org> 6 7if exists ( "did_indent_on" ) 8finish 9endif 10let did_indent_on = 1 11 12augroup filetypeindent 13au FileType * call s: LoadIndent () 14func ! s: LoadIndent () 15if exists ( "b:undo_indent" ) 16exe b: undo_indent 17unlet ! b: undo_indent b: did_indent 18endif 19let s = expand ( "<amatch>" ) 20if s != "" 21if exists ( "b:did_indent" ) 22unlet b: did_indent 23endif 24 25" When there is a dot it is used to separate filetype names. Thus for 26" "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim". 27for name in split ( s , '\.' ) 28" XXX: "[.]" in the pattern makes it a wildcard on Windows 29exe $ 'runtime! indent/{name}[.]{{vim,lua }}' 30endfor 31endif 32endfunc 33augroup END