aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2023-01-03 11:38:20 -0700
committerGitHub <noreply@github.com>2023-01-03 11:38:20 -0700
commitd56c603caf348ba97b8428c9fcb812f1182e07e9 (patch)
tree1d2b5e74ab33acb5eb9fc04934fea5a2f829feba /runtime/syntax
parenteb702273c4e862305c72b2b9354f7c3a32447135 (diff)
parentc951236d638af242626ffc1bc23df5a57549c0f5 (diff)
downloadrneovim-d56c603caf348ba97b8428c9fcb812f1182e07e9.tar.gz
rneovim-d56c603caf348ba97b8428c9fcb812f1182e07e9.tar.bz2
rneovim-d56c603caf348ba97b8428c9fcb812f1182e07e9.zip
Merge pull request #21633 from gpanders/editorconfig
Builtin EditorConfig support
Diffstat (limited to 'runtime/syntax')
-rw-r--r--runtime/syntax/editorconfig.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/syntax/editorconfig.vim b/runtime/syntax/editorconfig.vim
new file mode 100644
index 0000000000..006b99cec5
--- /dev/null
+++ b/runtime/syntax/editorconfig.vim
@@ -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'