etc/nvim/lua/indent.lua

39 lines
708 B
Lua
Raw Normal View History

2023-08-27 13:31:42 +03:00
2023-09-01 14:13:12 +03:00
-- Golang, C based configuration
2023-08-27 13:31:42 +03:00
vim.o.autoindent = true
vim.o.expandtab = false
vim.o.tabstop = 4
vim.o.shiftwidth = 4
createAutoCmd = vim.api.nvim_create_autocmd
createAutoCmd({
"BufNewFile",
"BufRead",
},{
pattern = "*.lua,*.js,*.jsx,*.scss,*.css,*.html,*.tmpl,*.tpl,*.yml,*.yaml,*.toml,*.tml",
2023-08-27 13:31:42 +03:00
callback = function()
local buf = vim.bo[vim.api.nvim_get_current_buf()]
buf.expandtab = true
buf.shiftwidth=2
buf.tabstop=2
buf.softtabstop = 0
end,
})
createAutoCmd({
"BufNewFile",
"BufRead",
},{
pattern = "*.md,*.py",
callback = function()
local buf = vim.bo[vim.api.nvim_get_current_buf()]
buf.expandtab = true
buf.shiftwidth=4
buf.tabstop=4
buf.softtabstop = 0
end,
})