update nvim plugins

This commit is contained in:
Alexander Navarro 2024-08-30 09:14:44 -04:00
parent 58a23e4a86
commit 282f40fc2a
Signed by untrusted user who does not match committer: anavarro
GPG key ID: 6426043E9FA3E3B5
4 changed files with 28 additions and 9 deletions

View file

@ -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,
},
{

View file

@ -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", "<leader>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,
}

View file

@ -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",