issue #133 change gT map to <Leader>gt

neovim_0.6
ray-x 2 years ago
parent ed1cedefb6
commit e80f004f5b

@ -402,7 +402,7 @@ details
| n | gp | definition preview (Go to Preview) |
| n | \<C-LeftMouse\> | definition |
| n | g\<LeftMouse\> | implementation |
| n | gT | treesitter document symbol |
| n | \<Leader>gt | treesitter document symbol |
| n | \<Leader\>gT | treesitter symbol for all open buffers |
| n | K | hover doc |
| n | \<Space\>ca | code action (when you see 🏏 ) |

@ -33,7 +33,7 @@ _NgConfigValues = {
transparency = 50, -- 0 ~ 100 blur the main window, 100: fully transparent, 0: opaque, set to nil to disable it
lsp_signature_help = true, -- if you would like to hook ray-x/lsp_signature plugin in navigator
-- setup here. if it is nil, navigator will not init signature help
signature_help_cfg = nil, -- if you would like to init ray-x/lsp_signature plugin in navigator, pass in signature help
signature_help_cfg = {debug=false}, -- if you would like to init ray-x/lsp_signature plugin in navigator, pass in signature help
lsp = {
code_action = {
enable = true,

@ -5,11 +5,12 @@ local event_hdlrs = {
{ ev = 'BufWritePre', func = [[require "navigator.diagnostics".set_diag_loclist()]] },
{ ev = 'CursorHold', func = 'document_highlight()' },
{ ev = 'CursorHoldI', func = 'document_highlight()' },
{ev = 'CursorMoved', func = 'clear_references()'}
{ ev = 'CursorMoved', func = 'clear_references()' },
}
local double = { '', '', '', '', '', '', '', '' }
local single = { '', '', '', '', '', '', '', '' }
-- TODO https://github.com/neovim/neovim/pull/16591 use vimkeymap.set/del
-- LuaFormatter off
local key_maps = {
{ key = 'gr', func = "require('navigator.reference').reference()" },
@ -21,7 +22,7 @@ local key_maps = {
{ key = '<c-]>', func = "require('navigator.definition').definition()" },
{ key = 'gD', func = "declaration({ border = 'rounded', max_width = 80 })" },
{ key = 'gp', func = "require('navigator.definition').definition_preview()" },
{ key = 'gT', func = "require('navigator.treesitter').buf_ts()" },
{ key = '<Leader>gt', func = "require('navigator.treesitter').buf_ts()" },
{ key = '<Leader>gT', func = "require('navigator.treesitter').bufs_ts()" },
{ key = 'K', func = 'hover({ popup_opts = { border = single, max_width = 80 }})' },
{ key = '<Space>ca', mode = 'n', func = "require('navigator.codeAction').code_action()" },
@ -56,7 +57,7 @@ local M = {}
local ccls_mappings = {
{ key = '<Leader>gi', func = "require('navigator.cclshierarchy').incoming_calls()" },
{key = '<Leader>go', func = "require('navigator.cclshierarchy').outgoing_calls()"}
{ key = '<Leader>go', func = "require('navigator.cclshierarchy').outgoing_calls()" },
}
local check_cap = function(cap)
@ -182,12 +183,15 @@ local function set_mapping(user_opts)
end
local function autocmd(user_opts)
vim.api.nvim_exec([[
vim.api.nvim_exec(
[[
aug NavigatorDocHlAu
au!
au CmdlineLeave : lua require('navigator.dochighlight').cmd_nohl()
aug END
]], false)
]],
false
)
end
local function set_event_handler(user_opts)
@ -262,7 +266,9 @@ function M.setup(user_opts)
-- TODO: when active signature merge to neovim, remove this setup:
if _NgConfigValues.signature_help_cfg or _NgConfigValues.lsp_signature_help then
if
_NgConfigValues.signature_help_cfg and #_NgConfigValues.signature_help_cfg > 0 or _NgConfigValues.lsp_signature_help
then
log('setup signature from navigator')
local hassig, sig = pcall(require, 'lsp_signature')
if hassig then
@ -270,7 +276,7 @@ function M.setup(user_opts)
end
else
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(require('navigator.signature').signature_handler, {
border = {'', '', '', '', '', '', '', ''}
border = { '', '', '', '', '', '', '', '' },
})
end
@ -289,7 +295,7 @@ M.get_keymaps_help = function()
prompt = true,
enter = true,
rect = { height = 20, width = 90 },
data = key_maps_help
data = key_maps_help,
})
return win

Loading…
Cancel
Save