factor out tabbing thing

This commit is contained in:
randomuser 2023-04-02 12:47:07 -05:00
parent 73c39f9eeb
commit f58dbe9264
1 changed files with 22 additions and 8 deletions

View File

@ -83,14 +83,28 @@ vim.api.nvim_create_autocmd({"BufWrite"}, {
})
-- autocmds for python
-- vim.api.nvim_create_autocmd({"Filetype"}, {
-- pattern = {"python"},
-- callback = function()
-- vim.bo.expandtab = true
-- vim.bo.tabstop = 4
-- vim.bo.shiftwidth = 4
-- end
-- })
function setTabbing(lang, width)
vim.api.nvim_create_autocmd({"Filetype"}, {
pattern = {"python"},
pattern = {lang},
callback = function()
vim.bo.expandtab = true
vim.bo.tabstop = 4
vim.bo.shiftwidth = 4
vim.bo.tabstop = width
vim.bo.shiftwidth = width
end
})
end
setTabbing("python", 4)
setTabbing("javascript", 2)
-- }}}
-- vim options {{{