add ale and git support, please remember to review these plugins

This commit is contained in:
niuzhaolong 2025-05-21 00:47:18 +08:00
parent 4acb617457
commit b98ab3c216
2 changed files with 42 additions and 0 deletions

34
lua/plugins/ale.lua Normal file
View File

@ -0,0 +1,34 @@
return {
{
"dense-analysis/ale",
event = { "BufReadPost", "BufNewFile" }, -- 延迟加载
init = function()
-- 禁用 ALE 补全(不再需要)
vim.g.ale_completion_enabled = 0
-- 全局 Fixers
vim.g.ale_fixers = {
['*'] = { 'remove_trailing_lines', 'trim_whitespace' },
}
-- 保存时自动修复
vim.g.ale_fix_on_save = 1
-- 浮动窗口样式Neovim 专属)
vim.g.ale_floating_preview = 1
vim.g.ale_floating_window_border = { '', '', '', '', '', '', '', '' }
vim.g.ale_hover_to_floating_preview = 1
end,
keys = {
-- 错误导航
{ "<C-k>", "<Plug>(ale_previous_wrap)", mode = "n", desc = "ALE Previous Error" },
{ "<C-j>", "<Plug>(ale_next_wrap)", mode = "n", desc = "ALE Next Error" },
-- 功能键位
{ "gh", "<Plug>(ale_hover)", mode = "n", desc = "ALE Hover" },
{ "<leader>d", "<Plug>(ale_detail)", mode = "n", desc = "ALE Detail" },
{ "<leader>x", "<Plug>(ale_fix)", mode = "n", desc = "ALE Fix" },
{ "<leader>g", "<Plug>(ale_go_to_definition_in_tab)", mode = "n", desc = "ALE Go to Definition (Tab)" },
{ "<leader>r", "<Plug>(ale_find_references)", mode = "n", desc = "ALE Find References" },
},
}
}

8
lua/plugins/git.lua Normal file
View File

@ -0,0 +1,8 @@
-- git support stuff
--
return {
{
"tpope/vim-fugitive",
event = "User GitPrompt", -- 按需加载
},
}