replace gd and the likes with glance

This commit is contained in:
2023-06-26 11:28:27 -04:00
parent a7524580f0
commit 66d9af30a9
3 changed files with 14 additions and 7 deletions

View File

@ -11,11 +11,11 @@ local function lsp_keymaps(bufnr)
-- LSP actions
map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
map('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
map('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
map('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
map('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
map('n', 'gD', '<cmd>lua vim.lsp.buf.definition()<cr>')
-- map('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
map('n', 'gI', '<cmd>lua vim.lsp.buf.implementation()<cr>')
map('n', 'gY', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
map('n', 'gR', '<cmd>lua vim.lsp.buf.references()<cr>')
map('n', '<S-Tab>', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
map('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
map('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')

View File

@ -59,8 +59,14 @@ a.nvim_create_autocmd('FileType', {
})
-- plugin binds ---------------------------------------------------------------
-- treesj
local treesj = require('treesj')
-- pretty lsp view
map('n', 'gd', '<CMD>Glance definitions<CR>')
map('n', 'gr', '<CMD>Glance references<CR>')
map('n', 'gy', '<CMD>Glance type_definitions<CR>')
map('n', 'gi', '<CMD>Glance implementations<CR>')
local treesj = require('treesj') -- treesj
map('n', '<leader>j', treesj.toggle)
-- telescope

View File

@ -90,6 +90,7 @@ require 'dep' {
-- lsp ----------------------------------------------------------------------
{ 'neovim/nvim-lspconfig' },
{ 'j-hui/fidget.nvim' }, -- shows lsp progress
{ 'dnlhc/glance.nvim' }, -- diagnostic info at a glance
{ 'folke/trouble.nvim' },
-- optional language specific lsp's