From 282f40fc2ade1f9aa080494d8efc20e464975df1 Mon Sep 17 00:00:00 2001 From: aleidk Date: Fri, 30 Aug 2024 09:14:44 -0400 Subject: [PATCH] update nvim plugins --- .../nvim/lua/aleidk/plugins/comments.lua | 4 ++-- .../nvim/lua/aleidk/plugins/formatter.lua | 18 +++++++++++++++--- .../nvim/lua/aleidk/plugins/sessions.lua | 10 +++++++++- .../dot_config/nvim/original_lazy-lock.json | 5 ++--- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/comments.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/comments.lua index 132a231..e9e3be9 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/comments.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/comments.lua @@ -10,7 +10,7 @@ return { options = { custom_commentstring = function() return require("ts_context_commentstring.internal").calculate_commentstring() - or vim.bo.commentstring + or vim.bo.commentstring end, }, }, @@ -28,7 +28,7 @@ return { -- left aligned fixed size box with left aligned text MAP({ "n", "v" }, "gcb", cb.lcbox, "Create a comment box") -- centered adapted box with centered text - MAP({ "n", "v" }, "gll", cb.cline, "Create a comment line") + MAP({ "n", "v" }, "gcl", cb.llline, "Create a comment line") end, }, { diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/formatter.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/formatter.lua index 8a60e17..4958617 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/formatter.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/formatter.lua @@ -12,6 +12,7 @@ return { ["_"] = { "trim_whitespace" }, blade = { "blade-formatter" }, css = { { "prettierd", "prettier" } }, + go = { { "gofumpt", "goimports_reviser", "golines" } }, html = { "prettierd" }, javascript = { { "prettierd", "prettier" } }, javascriptreact = { { "prettierd", "prettier" } }, @@ -26,9 +27,8 @@ return { sh = { "shfmt" }, typescript = { { "prettierd", "prettier" } }, typescriptreact = { { "prettierd", "prettier" } }, - zsh = { "shfmt" }, - go = { { "gofumpt", "goimports_reviser", "golines" } }, - xml = { "lemminx" } + xml = { "lemminx" }, + zsh = { "shfmt" } }, format_on_save = function(bufnr) -- Disable with a global or buffer-local variable @@ -52,5 +52,17 @@ return { end MAP("n", "uf", toggleAutoFormat, "Toggle auto format") + + vim.api.nvim_create_user_command("Format", function(args) + local range = nil + if args.count ~= -1 then + local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1] + range = { + start = { args.line1, 0 }, + ["end"] = { args.line2, end_line:len() }, + } + end + require("conform").format({ async = true, lsp_format = "fallback", range = range }) + end, { range = true }) end, } diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/sessions.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/sessions.lua index 9878d89..d6e19a8 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/sessions.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/sessions.lua @@ -5,7 +5,15 @@ return { ---@diagnostic disable-next-line: missing-fields require("auto-session").setup({ log_level = "error", - auto_session_suppress_dirs = { "~/", "~/Downloads", "/", "~/.config/**", "~/.local/share/chezmoi/" }, + auto_session_suppress_dirs = { + "/", + "~/", + "~/.config/**", + "~/.local/share/chezmoi/", + "~/.local/share/db_ui", + "~/.local/share/db_ui/**", + "~/Downloads", + }, bypass_session_save_file_types = { "NeogitStatus", "Lazy", diff --git a/chezmoi/dot_config/nvim/original_lazy-lock.json b/chezmoi/dot_config/nvim/original_lazy-lock.json index 362ab5d..4733d95 100644 --- a/chezmoi/dot_config/nvim/original_lazy-lock.json +++ b/chezmoi/dot_config/nvim/original_lazy-lock.json @@ -3,12 +3,12 @@ "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "auto-session": { "branch": "main", "commit": "4b0728715e674ad9c18f1519127dcaed59f9981b" }, - "bufferline.nvim": { "branch": "main", "commit": "aa16dafdc642594c7ade7e88d31a6119feb189d6" }, "ccc.nvim": { "branch": "main", "commit": "4fb5abaef2f2e0540fe22d4d74a9841205fff9e4" }, "chezmoi.nvim": { "branch": "main", "commit": "faf61465718424696269b2647077331b3e4605f1" }, "chezmoi.vim": { "branch": "main", "commit": "10f2692791b5e512a2c1bb4dc560b42ca5bf71fd" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-conventionalcommits": { "branch": "master", "commit": "a4dfacf0601130b7f8afa7c948d735c27802fb7f" }, "cmp-git": { "branch": "main", "commit": "22116bdffbe68bfc6ca05d52e9f217587cbfea8b" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, @@ -30,7 +30,6 @@ "lualine.nvim": { "branch": "master", "commit": "6a40b530539d2209f7dc0492f3681c8c126647ad" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, "mason.nvim": { "branch": "main", "commit": "f96a31855fa8aea55599cea412fe611b85a874ed" }, - "mini.bufremove": { "branch": "main", "commit": "1ee294a97e091d3cf967974df622c0d887890dc2" }, "mini.clue": { "branch": "main", "commit": "08f792869781b4bfdfcaa55eb905b9635c0a243f" }, "mini.comment": { "branch": "main", "commit": "c8406379987c321ecdef9f53e1ca741a55002104" }, "mini.surround": { "branch": "main", "commit": "3cb5b509ad34f2402df4b977be607a614c8c7524" }, @@ -74,4 +73,4 @@ "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "zen-mode.nvim": { "branch": "main", "commit": "2694c5a2bc4dc26c7a9e74b9e2b812920c90a830" } -} +} \ No newline at end of file