aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin
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/plugin
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/plugin')
-rw-r--r--runtime/plugin/editorconfig.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/plugin/editorconfig.lua b/runtime/plugin/editorconfig.lua
new file mode 100644
index 0000000000..60eb861aaa
--- /dev/null
+++ b/runtime/plugin/editorconfig.lua
@@ -0,0 +1,11 @@
+if vim.g.editorconfig_enable == false or vim.g.editorconfig_enable == 0 then
+ return
+end
+
+local group = vim.api.nvim_create_augroup('editorconfig', {})
+vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, {
+ group = group,
+ callback = function(args)
+ require('editorconfig').config(args.buf)
+ end,
+})