mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			420 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			420 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| local group = vim.api.nvim_create_augroup('editorconfig', {})
 | |
| vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead', 'BufFilePost' }, {
 | |
|   group = group,
 | |
|   callback = function(args)
 | |
|     -- Buffer-local enable has higher priority
 | |
|     local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true))
 | |
|     if not enable then
 | |
|       return
 | |
|     end
 | |
| 
 | |
|     require('editorconfig').config(args.buf)
 | |
|   end,
 | |
| })
 | 
