From d92f57336f314b879de8b084b9ce2b1f6f9daa20 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Mon, 28 Apr 2025 12:35:42 -0500 Subject: [PATCH] fix: Code actions related stuff --- laptop/config/plugins.lua | 12 ++++++++++++ laptop/plugin/lsp_config.lua | 2 +- laptop/plugin/treesitter.lua | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/laptop/config/plugins.lua b/laptop/config/plugins.lua index c7d06ea..0b0321e 100644 --- a/laptop/config/plugins.lua +++ b/laptop/config/plugins.lua @@ -90,7 +90,19 @@ require("lazy").setup({ event = "LspAttach", config = true, }, + { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + picker = { enabled = true }, + bigfile = { enabled = true }, + dashboard = { enabled = true }, + }, + }, "dvrlabs/takeout.nvim", + "aznhe21/actions-preview.nvim", }, lockfile = vim.fn.stdpath("config") .. "/config/lazy-lock.json", install = { missing = true, colorscheme = { "habamax" } }, diff --git a/laptop/plugin/lsp_config.lua b/laptop/plugin/lsp_config.lua index d69e5b0..407e0a1 100644 --- a/laptop/plugin/lsp_config.lua +++ b/laptop/plugin/lsp_config.lua @@ -9,7 +9,7 @@ local map = vim.keymap.set vim.api.nvim_create_autocmd("LspAttach", { callback = function() map('n', 'k', vim.lsp.buf.hover, { remap = false }) - map('n', 'a', vim.lsp.buf.code_action, { remap = false }) + map({ 'v', 'n' }, 'a', require("actions-preview").code_actions, { remap = false }) map('n', 'd', vim.diagnostic.open_float, { remap = false }) map('n', 'n', vim.diagnostic.goto_next, { remap = false }) map('n', 'N', vim.diagnostic.goto_prev, { remap = false }) diff --git a/laptop/plugin/treesitter.lua b/laptop/plugin/treesitter.lua index 0785428..0ac8e57 100644 --- a/laptop/plugin/treesitter.lua +++ b/laptop/plugin/treesitter.lua @@ -3,7 +3,7 @@ local configs = require("nvim-treesitter.configs") configs.setup({ ensure_installed = { "rust", "lua", "vim", "vimdoc", "ocaml", "yaml", "dockerfile", "bash", "html", "javascript", "css", "go", - "json", "python", "fish", "haskell" }, + "json", "python", "fish", "haskell", "diff" }, sync_install = false, disable = { "latex" }, highlight = {