You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nvim-lspconfig displays incoming and outgoing in quickfix, which does not display hierarchical relationships and perform hierarchical expansion operations, so I wrote such a plugin.
Feature
Display the call chain of the symbol under the cursor, including incoming and outgoing
Expand or collapse the upper or lower call chain
Ability to switch window position, editor center, or bottom right corner via mapkey
Highlight in the current module or others module
The icon of the last layer of the call chain will change to ☉
use {
'crusj/hierarchy-tree-go.nvim',
requires='neovim/nvim-lspconfig'
}
Start
require("hierarchy-tree-go").setup()
Default config
require("hierarchy-tree-go").setup({
icon= {
fold="", -- fold iconunfold="", -- unfold iconfunc="₣", -- symbollast='☉', -- last level icon
},
hl= {
current_module="guifg=Green", -- highlight cwd module lineothers_module="guifg=Black", -- highlight others module linecursorline="guibg=Gray guifg=White" -- hl window cursorline
},
keymap= {
--global keymapincoming="<space>fi", -- call incoming under cursorwordoutgoing="<space>fo", -- call outgoing under cursorwordopen="<space>ho", -- open hierarchy winclose="<space>hc", -- close hierarchy win-- focus: if hierarchy win is valid but is not current win, set to current win-- focus: if hierarchy win is valid and is current win, close-- focus if hierarchy win not existing,open and focusfocus="<space>fu",
-- bufkeymapexpand="o", -- expand or collapse hierarchyjump="<CR>", -- jumpmove="<space><space>" -- switch the hierarchy window position, must be current win
}
})
Keymap
Keymap
Action
Description
<space>fi
:lua require'hierarchy-tree-go'.incoming()
Call incoming under cursorword
<space>fo
:lua require'hierarchy-tree-go'.outgoing()
Call outgoing under cursorword
<space>ho
:lua require'hierarchy-tree-go'.open()
Open hierarchy window
<space>hc
:lua require'hierarchy-tree-go'.close()
Close hierarchy window
<space>fu
:lua require'hierarchy-tree-go'.focus()
Focus hierarchy window
o
:lua require'hierarchy-tree-go'.expand()
Expand or collapse hierarchy
<CR>
:lua require'hierarchy-tree-go'.jump()
Jump
<space><space>
:lua require'hierarchy-tree-go'.move()
switch the hierarchy window position, should be current win