robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Olivia Kinnearfeat(lua)!: vim.isnil, vim.nonnil, deprecate vim.F #39495fcd1d97265

master
405 B13 linesraw
1local group = vim.api.nvim_create_augroup('nvim.editorconfig', {})
2vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, {
3  group = group,
4  callback = function(ev)
5    -- Buffer-local enable has higher priority
6    local enable = vim.nonnil(vim.b.editorconfig, vim.g.editorconfig, true)
7    if not enable then
8      return
9    end
10
11    require('editorconfig').config(ev.buf)
12  end,
13})