mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
feat(editorconfig): add editorconfig syntax file
This is intentionally _not_ copied from Vim because our syntax file makes use of Lua to dynamically generate a list of valid EditorConfig properties. This requires the builtin editorconfig module, which Vim does not have.
This commit is contained in:
18
runtime/syntax/editorconfig.vim
Normal file
18
runtime/syntax/editorconfig.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
runtime! syntax/dosini.vim
|
||||
unlet! b:current_syntax
|
||||
|
||||
syntax match editorconfigInvalidProperty "^\s*\zs\w\+\ze\s*="
|
||||
syntax keyword editorconfigProperty root
|
||||
|
||||
lua<<
|
||||
local props = {}
|
||||
for k in pairs(require('editorconfig').properties) do
|
||||
props[#props + 1] = k
|
||||
end
|
||||
vim.cmd(string.format('syntax keyword editorconfigProperty %s', table.concat(props, ' ')))
|
||||
.
|
||||
|
||||
hi def link editorconfigInvalidProperty Error
|
||||
hi def link editorconfigProperty dosiniLabel
|
||||
|
||||
let b:current_syntax = 'editorconfig'
|
||||
Reference in New Issue
Block a user