From 984e69d9975c64cd951b9d3f1fc17247678d0f9c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 21 Aug 2023 19:47:47 +0900 Subject: neovim: uninstall editorconfig-vim in favor of native support of editorconfig --- .config/nvim/lua/vimrc/init.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to '.config/nvim/lua/vimrc/init.lua') diff --git a/.config/nvim/lua/vimrc/init.lua b/.config/nvim/lua/vimrc/init.lua index 562abd8..3148d02 100644 --- a/.config/nvim/lua/vimrc/init.lua +++ b/.config/nvim/lua/vimrc/init.lua @@ -31,10 +31,18 @@ end local function set_indentation(style, width) - vim.bo.expandtab = style - vim.bo.tabstop = width - vim.bo.shiftwidth = width - vim.bo.softtabstop = width + local editorconfig = vim.b.editorconfig or {} + + if not editorconfig.indent_style then + vim.bo.expandtab = style + end + if not editorconfig.tab_width then + vim.bo.tabstop = width + end + if not editorconfig.indent_size then + vim.bo.shiftwidth = width + vim.bo.softtabstop = width + end end -- cgit v1.2.3-70-g09d2