nvim: improvements to filetype
detection
This commit is contained in:
parent
448513ad70
commit
734c012556
1 changed files with 14 additions and 4 deletions
|
@ -2,13 +2,23 @@ local M = {}
|
|||
|
||||
M.setup = function()
|
||||
vim.filetype.add {
|
||||
-- 1. The file path/name is checked first.
|
||||
filename = {
|
||||
["clang-format"] = "yaml",
|
||||
editorconfig = "editorconfig",
|
||||
},
|
||||
-- 2. Patterns are checked second.
|
||||
pattern = {
|
||||
["${HOME}/.ssh/config.d/.*"] = "sshconfig",
|
||||
[".*/ssh/config"] = "sshconfig",
|
||||
|
||||
-- Files in my dotfiles repository.
|
||||
[".*/config/zsh/.*"] = "zsh",
|
||||
[".*/git/config"] = "gitconfig",
|
||||
[".*gitconfig"] = "gitconfig",
|
||||
[".*/home/editorconfig"] = "editorconfig",
|
||||
[".*config/zsh/.*"] = "zsh",
|
||||
[".*/ssh/config"] = "sshconfig",
|
||||
},
|
||||
-- 3. Finally, the extension is checked.
|
||||
extension = {
|
||||
gitconfig = "gitconfig",
|
||||
},
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue