File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ if vim.g.do_filetype_lua ~= 1 then
77 return
88end
99
10+ -- TODO: Remove vim.cmd once Lua autocommands land
1011vim .cmd [[
1112augroup filetypedetect
1213au BufRead,BufNewFile * call v:lua.vim.filetype.match(expand('<afile>'))
@@ -18,6 +19,12 @@ runtime! ftdetect/*.lua
1819" Set a marker so that the ftdetect scripts are not sourced a second time by filetype.vim
1920let g:did_load_ftdetect = 1
2021
22+ " If filetype.vim is disabled, set up the autocmd to use scripts.vim
23+ if exists('did_load_filetypes')
24+ au BufRead,BufNewFile * if !did_filetype() && expand('<amatch>') !~ g:ft_ignore_pat | runtime! scripts.vim | endif
25+ au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
26+ endif
27+
2128augroup END
2229]]
2330
You can’t perform that action at this time.
0 commit comments