diff --git a/.config/nvim/lua/config/maps.lua b/.config/nvim/lua/config/maps.lua --- a/.config/nvim/lua/config/maps.lua +++ b/.config/nvim/lua/config/maps.lua @@ -66,7 +66,16 @@ map("n", "te", ":Tabularize firs map("n", "tc", ":Tabularize first_colon") map("n", "tm", ":Tabularize methods") -map("n", "a", ":call vimrc#AutoFmtToggle()") +map("n", "a", function() + local fo = vim.bo.formatoptions + if fo:find("a") then + vim.bo.formatoptions = fo:gsub("a", "") + vim.print("-a") + else + vim.bo.formatoptions = fo .. "a" + vim.print("+a") + end +end) -- LSP features