You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15 lines
342 B

local function ToggleTabs()
local options = {"tabstop", "softtabstop", "shiftwidth"}
for _, option in ipairs(options) do
local current_value = vim.opt[option]:get()
vim.opt[option] = (current_value == 4) and 2 or 4
end
end
vim.api.nvim_create_user_command(
'ToggleTabs',
ToggleTabs,
{ nargs = 0 }
)