moved ftplugins, and fixed some plugins
This commit is contained in:
parent
3a09e91ad6
commit
8c56556c86
23 changed files with 578 additions and 244 deletions
|
|
@ -5,6 +5,17 @@ return {
|
|||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
},
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
cmd = { 'ConformInfo' },
|
||||
keys = {
|
||||
{
|
||||
'<leader>f',
|
||||
function()
|
||||
require('conform').format({ async = true, lsp_fallback = true })
|
||||
end,
|
||||
mode = '',
|
||||
desc = '[F]ormat buffer',
|
||||
},
|
||||
},
|
||||
opts = function()
|
||||
local formatters_by_ft = {
|
||||
lua = { 'stylua' },
|
||||
|
|
@ -16,33 +27,38 @@ return {
|
|||
end
|
||||
end,
|
||||
go = { 'gofumpt', 'goimports' },
|
||||
yaml = { 'prettier' }, -- Added YAML formatter
|
||||
bash = { 'shfmt' }, -- Added Bash formatter
|
||||
rust = { 'rustfmt' }, -- Added Rust formatter
|
||||
dockerfile = { 'hadolint' }, -- Added Dockerfile formatter
|
||||
yaml = { 'prettier' },
|
||||
bash = { 'shfmt' },
|
||||
rust = { 'rustfmt' },
|
||||
dockerfile = { 'hadolint' },
|
||||
}
|
||||
|
||||
require('conform').setup({
|
||||
return {
|
||||
notify_on_error = false,
|
||||
format_on_save = function(bufnr)
|
||||
local disable_filetypes = { c = true, cpp = true }
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
||||
}
|
||||
end,
|
||||
formatters_by_ft = formatters_by_ft,
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
timeout_ms = 500,
|
||||
},
|
||||
})
|
||||
}
|
||||
end,
|
||||
config = function(_, opts)
|
||||
require('conform').setup(opts)
|
||||
|
||||
require('mason-tool-installer').setup({
|
||||
ensure_installed = {
|
||||
'stylua', -- Lua
|
||||
'ruff', -- Python
|
||||
'isort', -- Python
|
||||
'black', -- Python
|
||||
'gofumpt', -- Go
|
||||
'goimports', -- Go
|
||||
'prettier', -- YAML, JSON, etc.
|
||||
'shfmt', -- Bash
|
||||
'hadolint', -- Dockerfile
|
||||
'stylua',
|
||||
'ruff',
|
||||
'isort',
|
||||
'black',
|
||||
'gofumpt',
|
||||
'goimports',
|
||||
'shfmt',
|
||||
'hadolint',
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue