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.
 
 
 

19 lines
434 B

local tabWidth = 4
function ToggleTabWidth()
if tabWidth == 2 then
vim.o.tabstop = 4
vim.o.softtabstop = 4
vim.o.shiftwidth = 4
tabWidth = 4
print('Set tab width to 4')
return
end
vim.o.tabstop = 2
vim.o.softtabstop = 2
vim.o.shiftwidth = 2
tabWidth = 2
print('Set tab width to 2')
end
vim.keymap.set('n', '<leader>tt', ToggleTabWidth, { noremap = true })