From b2d372c5385f6065171c5f47f8ad364c504e2eae Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Thu, 26 Mar 2026 13:50:55 -0400 Subject: [PATCH] Update formatters and fix slow load bug with rustfmt --- ftplugin/python.vim | 3 --- lazy-lock.json | 6 +++--- lua/config/formatting.lua | 6 ++---- lua/config/keymaps.lua | 3 ++- lua/plugins/formatting.lua | 20 +++++++++++++++++--- lua/plugins/lsp.lua | 1 + 6 files changed, 25 insertions(+), 14 deletions(-) delete mode 100644 ftplugin/python.vim diff --git a/ftplugin/python.vim b/ftplugin/python.vim deleted file mode 100644 index 396f421..0000000 --- a/ftplugin/python.vim +++ /dev/null @@ -1,3 +0,0 @@ -set colorcolumn=100 -nmap ;x [hv]h]hk$;sc -set tw=1000 diff --git a/lazy-lock.json b/lazy-lock.json index c75ab85..59ac9a6 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,9 +6,9 @@ "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "conform.nvim": { "branch": "master", "commit": "eebc724d12c5579d733d1f801386e0ceb909d001" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "git-blame.nvim": { "branch": "master", "commit": "8503b199edf9a666fe7b1a989cf14e3c26b2eb03" }, + "git-blame.nvim": { "branch": "main", "commit": "8503b199edf9a666fe7b1a989cf14e3c26b2eb03" }, "iron.nvim": { "branch": "master", "commit": "93b3b97cf4313613fba5e91055deaf091cd78483" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" }, @@ -21,7 +21,7 @@ "nvim-jdtls": { "branch": "master", "commit": "c23f200fee469a415c77265ca55b496feb646992" }, "nvim-lspconfig": { "branch": "master", "commit": "d3ad666b7895f958d088cceb6f6c199672c404fe" }, "nvim-markdown": { "branch": "master", "commit": "cfe80a1054ccc168ae9ef28062472e78f710f9f4" }, - "nvim-treesitter": { "branch": "master", "commit": "205faba1768a6e4c854f156bc6a21a41b242599c" }, + "nvim-treesitter": { "branch": "main", "commit": "205faba1768a6e4c854f156bc6a21a41b242599c" }, "nvim-web-devicons": { "branch": "master", "commit": "57dfa947cc88cdf1baa2c7e13ed31edddd8fb1d1" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "rainbow_csv": { "branch": "master", "commit": "3dbbfd7d17536aebfb80f571255548495574c32b" }, diff --git a/lua/config/formatting.lua b/lua/config/formatting.lua index 19efff5..5a4a5fb 100644 --- a/lua/config/formatting.lua +++ b/lua/config/formatting.lua @@ -1,8 +1,5 @@ -- Formatting configuration --- Set rustfmt command -vim.g["rustfmt_command"] = "rustfmt +nightly" - -- Commands to disable/enable formatting require("conform").setup({ format_on_save = function(bufnr) @@ -31,4 +28,5 @@ vim.api.nvim_create_user_command("FormatEnable", function() vim.g.disable_autoformat = false end, { desc = "Re-enable autoformat-on-save", -}) \ No newline at end of file +}) + diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index ddec785..d831f0a 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -16,4 +16,5 @@ vim.keymap.set("n", "", "", { desc = "Move focus to the lower win vim.keymap.set("n", "", "", { desc = "Move focus to the upper window" }) -- LSP keymaps -vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Goto Definition" }) \ No newline at end of file +vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Goto Definition" }) + diff --git a/lua/plugins/formatting.lua b/lua/plugins/formatting.lua index 2ac164d..8b4df2d 100644 --- a/lua/plugins/formatting.lua +++ b/lua/plugins/formatting.lua @@ -9,13 +9,22 @@ return { command = "black", prepend_args = { "--line-length", "100" }, }, + "prettier", + formatters = { + golines = { + args = { + "--max-len=100", + "--base-formatter=gofmt", + }, + }, + }, }, }, opts = { notify_on_error = false, format_on_save = { - timeout_ms = 500, - lsp_fallback = false, + timeout_ms = 2500, + lsp_fallback = true, }, formatters_by_ft = { lua = { "stylua" }, @@ -25,7 +34,12 @@ return { sh = { "beautysh" }, tex = { "latexindent" }, java = { "java" }, + javascript = { "prettier" }, + typescript = { "prettier" }, + typescriptreact = { "prettier" }, + json = { "prettier" }, + go = { "golines" }, }, }, }, -} \ No newline at end of file +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 42f0f3a..54af8ab 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -181,6 +181,7 @@ return { "jdtls", "stylua", "black", + "golines", "clang-format", "beautysh", "latexindent",