35 lines
1.3 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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