Skip to content

Commit

Permalink
neovim: add snacks plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Jan 17, 2025
1 parent cb31cc2 commit 799b71f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions home/neovim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ return {
if not c then return end

-- set up keybinds
vim.keymap.set("n", "gy", vim.lsp.buf.type_definition, { noremap = true, silent = true, buffer = buf, desc = "Go to type definition" })
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { noremap = true, silent = true, buffer = buf, desc = "Find implementations" })
vim.keymap.set("n", "<leader>r", vim.lsp.buf.rename, { noremap = true, silent = true, buffer = buf, desc = "Rename symbol" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { noremap = true, silent = true, buffer = buf, desc = "Go to next error" })
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { noremap = true, silent = true, buffer = buf, desc = "Go to previous error" })
Expand Down
32 changes: 32 additions & 0 deletions home/neovim/lua/plugins/snacks.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
return {
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
bigfile = { enabled = true },
input = { enabled = true },
notifier = { enabled = true },
quickfile = { enabled = true },
words = { enabled = true },
},
keys = {
{ "<leader>f", function() require("snacks.picker").git_files() end, desc = "Find git files" },
{ "<leader>F", function() require("snacks.picker").files() end, desc = "Find files" },
{ "<leader>d", function() require("snacks.picker").diagnostics() end, desc = "LSP diagnostics" },
{ "<leader>S", function() require("snacks.picker").lsp_symbols() end, desc = "LSP symbols" },
{ "<leader>b", function() require("snacks.picker").buffers() end, desc = "Open buffers" },
{ "gd", function() require("snacks.picker").lsp_definitions() end, desc = "LSP definitions" },
{ "gr", function() require("snacks.picker").lsp_references() end, desc = "LSP references" },
{ "gi", function() require("snacks.picker").lsp_implementations() end, desc = "LSP implementations" },
{ "gy", function() require("snacks.picker").lsp_type_definitions() end, desc = "LSP type definition" },
{ "<leader>j", function() require("snacks.picker").jumps() end, desc = "Jump list" },
{ "<leader>ht", function() require("snacks.picker").help() end, desc = "Help tags" },
{ "<leader><space>", function() require("snacks.picker").grep() end, desc = "Perform a live grep over the project" },
},
}
}

0 comments on commit 799b71f

Please sign in to comment.