feat(nvim): new align plugin

also changed the keymap of code actions preview
This commit is contained in:
Sergio Laín 2023-10-13 14:42:45 +02:00
parent 122da8910d
commit 02f4037323
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
4 changed files with 32 additions and 43 deletions

View file

@ -1,29 +1,23 @@
return {
{
"aznhe21/actions-preview.nvim",
event = "BufRead",
config = function()
vim.keymap.set(
{ "v", "n" },
"ga",
require("actions-preview").code_actions,
{ noremap = true, silent = true, desc = "Code Actions" }
)
require("actions-preview").setup({
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
},
})
end,
},
{
"aznhe21/actions-preview.nvim",
event = "BufRead",
config = function()
require("actions-preview").setup({
telescope = {
sorting_strategy = "ascending",
layout_strategy = "vertical",
layout_config = {
width = 0.8,
height = 0.9,
prompt_position = "top",
preview_cutoff = 20,
preview_height = function(_, _, max_lines)
return max_lines - 15
end,
},
},
})
end,
},
}

View file

@ -7,6 +7,7 @@ return {
keys[#keys + 1] = { "gr", "<CMD>Glance references<CR>", desc = "References" }
keys[#keys + 1] = { "gy", "<CMD>Glance type_definitions<CR>", desc = "Goto t[y]pe definitions" }
keys[#keys + 1] = { "gI", "<CMD>Glance implementations<CR>", desc = "Goto implementations" }
keys[#keys + 1] = { "<leader>ca", require("actions-preview").code_actions, desc = "Code Action Preview" }
end,
opts = {
-- options for vim.diagnostic.config()

View file

@ -0,0 +1,10 @@
return {
{
"echasnovski/mini.align",
opts = {},
keys = {
{ "ga", mode = { "n", "v" }, desc = "Align" },
{ "gA", mode = { "n", "v" }, desc = "Align Preview" },
},
},
}

View file

@ -1,16 +0,0 @@
return {
{
"echasnovski/mini.starter",
optional = true,
opts = function(_, opts)
local items = {
{
name = "Workspaces",
action = "Telescope workspaces",
section = string.rep(" ", 22) .. "Telescope",
},
}
vim.list_extend(opts.items, items)
end,
}
}