robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
cbf54ec2a5
master
1" Vim support file to switch on loading plugins 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_load_ftplugin" ) 8finish 9endif 10let did_load_ftplugin = 1 11 12augroup filetypeplugin 13au FileType * call s: LoadFTPlugin () 14 15func ! s: LoadFTPlugin () 16if exists ( "b:undo_ftplugin" ) 17exe b: undo_ftplugin 18unlet ! b: undo_ftplugin b: did_ftplugin 19endif 20 21let s = expand ( "<amatch>" ) 22if s != "" 23if & cpo =~# "S" && exists ( "b:did_ftplugin" ) 24" In compatible mode options are reset to the global values, need to 25" set the local values also when a plugin was already used. 26unlet b: did_ftplugin 27endif 28 29" When there is a dot it is used to separate filetype names. Thus for 30" "aaa.bbb" load "aaa" and then "bbb". 31for name in split ( s , '\.' ) 32" Load Lua ftplugins after Vim ftplugins _per directory_ 33" TODO(clason): use nvim__get_runtime when supports globs and modeline 34" XXX: "[.]" in the first pattern makes it a wildcard on Windows 35exe $ 'runtime! ftplugin/{name}[.]{{vim,lua }} ftplugin/{name}_*.{{vim,lua }} ftplugin/{name}/*.{{vim,lua }}' 36endfor 37endif 38endfunc 39augroup END