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 })
|