diff --git a/dots/.config/nvim/lua/core/filetypes.lua b/dots/.config/nvim/lua/core/filetypes.lua index 3f940d63..6076d23d 100644 --- a/dots/.config/nvim/lua/core/filetypes.lua +++ b/dots/.config/nvim/lua/core/filetypes.lua @@ -11,12 +11,14 @@ M.setup = function() [".*/Azure%-Pipelines/.*%.yaml"] = "azure-pipelines", [".*/waybar/config"] = "jsonc", [".*/etc/systemd/.*"] = "systemd", + [".*%.psql"] = "sql" }, }) vim.treesitter.language.register("yaml", "azure-pipelines") vim.treesitter.language.register("gitignore", "dockerignore") vim.treesitter.language.register("html", "xml") + vim.treesitter.language.register("sql", "psql") end return M diff --git a/dots/.config/nvim/lua/plugins/configs/formatter.lua b/dots/.config/nvim/lua/plugins/configs/formatter.lua index 5d369816..a3673fef 100644 --- a/dots/.config/nvim/lua/plugins/configs/formatter.lua +++ b/dots/.config/nvim/lua/plugins/configs/formatter.lua @@ -25,6 +25,24 @@ return { markdown = filetypes.markdown.prettierd, css = filetypes.css.prettierd, lua = filetypes.lua.stylua, + psql = function () + return { + exe = "sql-formatter", + args = { + "-l", + "postgresql", + "--fix", + }, + } + end, + sql = function () + return { + exe = "sql-formatter", + args = { + "--fix", + }, + } + end, asm = function() return { exe = "asmfmt",