mirror of
https://github.com/gabehf/nvim-conf.git
synced 2026-03-08 15:08:17 -07:00
use telescope for [g]et [r]eferences
This commit is contained in:
parent
15ab840ed5
commit
d2c7d4a064
1 changed files with 34 additions and 2 deletions
|
|
@ -1,5 +1,37 @@
|
|||
-- EXAMPLE
|
||||
local on_attach = require("nvchad.configs.lspconfig").on_attach
|
||||
local map = vim.keymap.set
|
||||
local conf = require("nvconfig").ui.lsp
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local function opts(desc)
|
||||
return { buffer = bufnr, desc = desc }
|
||||
end
|
||||
|
||||
map("n", "gD", vim.lsp.buf.declaration, opts "Lsp Go to declaration")
|
||||
map("n", "gd", vim.lsp.buf.definition, opts "Lsp Go to definition")
|
||||
map("n", "K", vim.lsp.buf.hover, opts "Lsp hover information")
|
||||
map("n", "gi", vim.lsp.buf.implementation, opts "Lsp Go to implementation")
|
||||
map("n", "<leader>sh", vim.lsp.buf.signature_help, opts "Lsp Show signature help")
|
||||
map("n", "<leader>wa", vim.lsp.buf.add_workspace_folder, opts "Lsp Add workspace folder")
|
||||
map("n", "<leader>wr", vim.lsp.buf.remove_workspace_folder, opts "Lsp Remove workspace folder")
|
||||
|
||||
map("n", "<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts "Lsp List workspace folders")
|
||||
|
||||
map("n", "<leader>D", vim.lsp.buf.type_definition, opts "Lsp Go to type definition")
|
||||
|
||||
map("n", "<leader>ra", function()
|
||||
require "nvchad.lsp.renamer"()
|
||||
end, opts "Lsp NvRenamer")
|
||||
|
||||
map({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts "Lsp Code action")
|
||||
map("n", "gr", "<cmd>Telescope lsp_references<CR>", opts "[G]et [R]eferences")
|
||||
|
||||
-- setup signature popup
|
||||
if conf.signature and client.server_capabilities.signatureHelpProvider then
|
||||
require("nvchad.lsp.signature").setup(client, bufnr)
|
||||
end
|
||||
end
|
||||
local on_init = require("nvchad.configs.lspconfig").on_init
|
||||
local capabilities = require("nvchad.configs.lspconfig").capabilities
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue