chore(nvim): mason tools, sessionopts

This commit is contained in:
2025-01-02 14:15:06 +02:00
parent 4f154cf509
commit 3060b6ad66
2 changed files with 17 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ o.termguicolors = true -- Enable GUI colors
o.timeoutlen = 250 -- Decrease mapped sequence wait time
o.updatetime = 250 -- 250 ms = 2,5 seconds
o.sessionoptions =
'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions'
'buffers,curdir,folds,tabpages,winsize,winpos,terminal,localoptions'
-- Enable the colorcolumn
vim.api.nvim_set_option_value('colorcolumn', '+1', { scope = 'global' })

View File

@@ -196,12 +196,16 @@ return {
'goimports',
'gotests',
'phpcbf',
'phpmd',
'phpstan',
'pint',
'prettierd',
'semgrep',
'shellcheck',
'shfmt',
'staticcheck',
'stylua',
'trivy',
'vint',
'yamlfmt',
},
@@ -284,6 +288,8 @@ return {
validate = { enable = true },
},
}
-- end of junnplus/lsp-setup config
end,
},
@@ -317,6 +323,11 @@ return {
else
lsp_format_opt = 'fallback'
end
-- Disable autoformat for files in a certain path
local bufname = vim.api.nvim_buf_get_name(bufnr)
if bufname:match '/node_modules/' then return end
return {
timeout_ms = 500,
lsp_format = lsp_format_opt,
@@ -326,6 +337,7 @@ return {
lua = { 'stylua' },
sh = { 'shfmt' },
bash = { 'shfmt' },
php = { 'phpcbf' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
@@ -333,6 +345,10 @@ return {
-- javascript = { "prettierd", "prettier", stop_after_first = true },
},
},
init = function()
-- If you want the formatexpr, here is the place to set it
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end,
},
-- Automatically install formatters registered with conform.nvim via mason.nvim
-- https://github.com/zapling/mason-conform.nvim