Vanquish ftdetect, long live vim.filetype.add()

This commit is contained in:
Kenneth Benzie 2024-05-22 21:29:36 +01:00
parent 4499dee3d6
commit 48ad466bd3
10 changed files with 19 additions and 20 deletions

View File

@ -1 +0,0 @@
autocmd BufNewFile,BufReadPost CMakeCache.txt set filetype=cmakecache

View File

@ -1,2 +0,0 @@
" Force *.def to C++ filetype for LLVM
au BufNewFile,BufReadPost *.def set filetype=cpp

View File

@ -1,3 +0,0 @@
" Set .ll files to LLVM IR filetype
au BufNewFile,BufReadPost *.ll set filetype=llvm
au BufNewFile,BufReadPost *.test set filetype=llvm

View File

@ -1,3 +0,0 @@
" Force *.md to markdown filetype
au BufNewFile,BufReadPost *.md set filetype=markdown
au BufNewFile,BufReadPost *.ronn set filetype=markdown

View File

@ -1,2 +0,0 @@
" Force *.cl to OpenCL C filetype
au BufNewFile,BufReadPost *.cl set filetype=opencl

View File

@ -1,3 +0,0 @@
" Force lit.cfg/lit.local.cfg to be Python
au BufNewFile,BufReadPost lit.cfg set filetype=python
au BufNewFile,BufReadPost lit.local.cfg set filetype=python

View File

@ -1 +0,0 @@
autocmd BufNewFile,BufReadPost */requirements.txt set filetype=requirements

View File

@ -1,2 +0,0 @@
" Force *.td to tablegen filetype
au BufNewFile,BufReadPost *.td set filetype=tablegen

View File

@ -1,3 +0,0 @@
" Force .enter/.exit to be zsh
au BufNewFile,BufReadPost .enter set filetype=zsh
au BufNewFile,BufReadPost .exit set filetype=zsh

19
plugin/filetype.lua Normal file
View File

@ -0,0 +1,19 @@
vim.filetype.add({
extension = {
cl = 'opencl',
def = 'cpp',
ll = 'llvm',
md = 'markdown',
ronn = 'markdown',
td = 'tablegen',
test = 'llvm',
},
filename = {
['.enter'] = 'zsh',
['.exit'] = 'zsh',
['CMakeCache.txt'] = 'cmakecache',
['lit.cfg'] = 'python',
['lit.local.cfg'] = 'python',
['requirements.txt'] = 'requirements',
},
})