]> Git — Sourcephile - julm/julm-nix.git/blob - home-manager/profiles/nvim/lua/plugins/fastaction.lua
neovim: configure, using ghostty and tmux
[julm/julm-nix.git] / home-manager / profiles / nvim / lua / plugins / fastaction.lua
1 -- Efficiency plugin designed to optimize code actions in Neovim.
2 -- https://github.com/Chaitanyabsprip/fastaction.nvim
3 vim.keymap.set(
4 { "n", "x" },
5 "<leader>a",
6 '<cmd>lua require("fastaction").code_action()<CR>',
7 { desc = "Display code actions", buffer = bufnr }
8 )
9 vim.keymap.set(
10 { "n", "x" },
11 "<leader>A",
12 '<cmd>lua require("fastaction").code_action({ select_first = true })<CR>',
13 { desc = "Select and apply first code action", buffer = bufnr }
14 )
15 return {
16 "fastaction.nvim",
17 event = { "LspAttach" },
18 after = function()
19 require("fastaction").setup({
20 dismiss_keys = { "j", "k", "<c-c>", "q" },
21 override_function = function(_) end,
22 keys = "azertyuiopqsdfghjklm",
23 popup = {
24 border = "rounded",
25 hide_cursor = true,
26 highlight = {
27 action = "MoreMsg",
28 divider = "FloatBorder",
29 key = "MoreMsg",
30 source = "Comment",
31 title = "Title",
32 window = "NormalFloat",
33 },
34 title = "Select one of:",
35 },
36 priority = {
37 -- dart = {
38 -- { pattern = "organize import", key ="o", order = 1 },
39 -- { pattern = "extract method", key ="x", order = 2 },
40 -- { pattern = "extract widget", key ="e", order = 3 },
41 -- },
42 },
43 register_ui_select = true,
44 format_right_section = nil,
45 })
46 end,
47 }