Files
neovim/runtime/plugin/editorconfig.lua
Justin M. Keyes 7ea148a1dc docs: use "ev" convention in event-handlers
Problem:
In autocmd examples, using "args" as the event-object name is vague and
may be confused with a user-command.

Solution:
Use "ev" as the conventional event-object name.
2026-03-12 11:12:56 +01:00

14 lines
407 B
Lua

local group = vim.api.nvim_create_augroup('nvim.editorconfig', {})
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, {
group = group,
callback = function(ev)
-- Buffer-local enable has higher priority
local enable = vim.F.if_nil(vim.b.editorconfig, vim.g.editorconfig, true)
if not enable then
return
end
require('editorconfig').config(ev.buf)
end,
})