Files
godotdev.nvim/lua/godotdev/formatting.lua

24 lines
559 B
Lua
Raw Normal View History

2025-09-07 09:40:38 +02:00
vim.api.nvim_create_autocmd("FileType", {
pattern = "gdscript",
callback = function()
2025-09-08 09:08:48 +02:00
vim.bo.expandtab = true
vim.bo.shiftwidth = 4
2025-09-07 09:40:38 +02:00
vim.bo.softtabstop = 4
2025-09-08 09:08:48 +02:00
vim.bo.tabstop = 4
vim.bo.autoindent = true
2025-09-07 09:40:38 +02:00
vim.bo.smartindent = true
end,
})
2025-09-08 09:06:30 +02:00
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.gd",
callback = function()
2025-09-08 09:08:48 +02:00
if vim.fn.executable("gdformat") == 1 then
vim.cmd("silent !gdformat %")
vim.cmd("checktime")
else
vim.notify("gdformat not found in PATH", vim.log.levels.WARN)
end
2025-09-08 09:06:30 +02:00
end,
})