Skip to content

Commit

Permalink
Adjust some lsp commands
Browse files Browse the repository at this point in the history
  • Loading branch information
djensenius committed Sep 14, 2024
1 parent 8fe246b commit 99e7067
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nvim/lua/plugins/nvim-lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ return {
-- Prepare completion
local on_attach = function(client)
-- Mappings.
vim.keymap.set("n", "<leader><space>D", vim.lsp.buf.declaration, { desc = "Go to declaration" })
vim.keymap.set("n", "<leader><space>f", vim.lsp.buf.definition, { desc = "Go to definition" })
vim.keymap.set("n", "<leader><space>c", vim.lsp.buf.declaration, { desc = "Go to declaration" })
vim.keymap.set("n", "<leader><space>D", function()
require("telescope.builtin").lsp_definitions({ jump_type = "never" })
end, { desc = "Go to definition" })
vim.keymap.set("n", "<leader><space>h", vim.lsp.buf.hover, { desc = "Show hover" })
vim.keymap.set("n", "<leader><space>i", vim.lsp.buf.implementation, { desc = "Go to implementation" })
vim.keymap.set("n", "<leader><space>S", vim.lsp.buf.signature_help, { desc = "Show signature help" })
vim.keymap.set("n", "<leader><space>R", vim.lsp.buf.rename, { desc = "Rename" })
vim.keymap.set("n", "<leader><space>r", vim.lsp.buf.references, { desc = "Show references" })
vim.keymap.set("n", "<leader><space>r", function()
require("telescope.builtin").lsp_references()
end, { desc = "Show references" })
vim.keymap.set("n", "<leader><space>d", vim.diagnostic.open_float, { desc = "Show diagnostics" })
vim.keymap.set("n", "<leader><space>i", vim.lsp.buf.code_action, { desc = "Show code actions" })
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous diagnostic" })
Expand Down
6 changes: 6 additions & 0 deletions nvim/lua/plugins/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ return {
vim.keymap.set("n", "<leader>fb", '<cmd>lua require("telescope.builtin").buffers()<cr>')
vim.keymap.set("n", "<leader>fh", '<cmd>lua require("telescope.builtin").help_tags()<cr>')
vim.keymap.set("n", "<leader>fn", "<cmd>Telescope notify<cr>")
vim.keymap.set("n", "<leader>fd", function()
require("telescope.builtin").lsp_definitions({ jump_type = "never" })
end)
vim.keymap.set("n", "<leader>fr", function()
require("telescope.builtin").lsp_references()
end)
require("telescope").load_extension("fzf")
require("telescope").load_extension("ui-select")
end,
Expand Down
2 changes: 2 additions & 0 deletions nvim/lua/plugins/which-key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ return {
{ "<leader>f", group = "Finding & Format" },
{ "<leader>fb", desc = "Buffers" },
{ "<leader>ff", desc = "Files" },
{ "<leader>fr", desc = "References" },
{ "<leader>fd", desc = "Declarations" },
{ "<leader>fg", desc = "Search (grep)" },
{ "<leader>fh", desc = "Help", icon="󰋖" },
{ "<leader>fm", group = "Format" },
Expand Down

0 comments on commit 99e7067

Please sign in to comment.