From b19167a1ab1e6d3c21d67788d404c159aeaaf306 Mon Sep 17 00:00:00 2001 From: Squibid Date: Mon, 26 Jun 2023 11:28:27 -0400 Subject: replace gd and the likes with glance --- after/plugin/lsp.lua | 10 +++++----- lua/core/binds.lua | 10 ++++++++-- lua/core/plugins.lua | 1 + 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 8ec7f13..4e5d3fa 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -11,11 +11,11 @@ local function lsp_keymaps(bufnr) -- LSP actions map('n', 'K', 'lua vim.lsp.buf.hover()') - map('n', 'gd', 'lua vim.lsp.buf.definition()') - map('n', 'gD', 'lua vim.lsp.buf.declaration()') - map('n', 'gi', 'lua vim.lsp.buf.implementation()') - map('n', 'go', 'lua vim.lsp.buf.type_definition()') - map('n', 'gr', 'lua vim.lsp.buf.references()') + map('n', 'gD', 'lua vim.lsp.buf.definition()') + -- map('n', 'gD', 'lua vim.lsp.buf.declaration()') + map('n', 'gI', 'lua vim.lsp.buf.implementation()') + map('n', 'gY', 'lua vim.lsp.buf.type_definition()') + map('n', 'gR', 'lua vim.lsp.buf.references()') map('n', '', 'lua vim.lsp.buf.signature_help()') map('n', '', 'lua vim.lsp.buf.rename()') map('n', '', 'lua vim.lsp.buf.code_action()') diff --git a/lua/core/binds.lua b/lua/core/binds.lua index 7a7fce0..66a2af5 100644 --- a/lua/core/binds.lua +++ b/lua/core/binds.lua @@ -59,8 +59,14 @@ a.nvim_create_autocmd('FileType', { }) -- plugin binds --------------------------------------------------------------- --- treesj -local treesj = require('treesj') + +-- pretty lsp view +map('n', 'gd', 'Glance definitions') +map('n', 'gr', 'Glance references') +map('n', 'gy', 'Glance type_definitions') +map('n', 'gi', 'Glance implementations') + +local treesj = require('treesj') -- treesj map('n', 'j', treesj.toggle) -- telescope diff --git a/lua/core/plugins.lua b/lua/core/plugins.lua index 40ca880..5ad5474 100644 --- a/lua/core/plugins.lua +++ b/lua/core/plugins.lua @@ -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 -- cgit v1.2.1