2
GitHub - liushihao456/symbols-outline.el: Display symbols (functions, variables,...
source link: https://github.com/liushihao456/symbols-outline.el
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Introduction
This package displays all the symbols (including classes, functions, variables, etc., depending on what the backend outputs), in an outline view.
Features
- List the symbols in a well-organized window.
- The outline window position follows your cursor in the original buffer.
- It's easy to navigate between symbols via moving in the outline window.
- Allows various and custom backends. Currently ctags and lsp-mode backends are provided.
Requirements
Symbols-outline.el relies on a backend to get the symbols. By default the ctags backend is used. Or if lsp-mode
is active, you can use the lsp backend. See symbols-outline-fetch-fn
.
If using ctags backend, ctags
must be installed on your machine.
Installation
This package is in Melpa so you can install it with your favorite package manager.
Example configuration
(global-set-key (kbd "C-c i") 'symbols-outline-show)
(with-eval-after-load 'symbols-outline
;; By default the ctags backend is selected
(unless (executable-find "ctags")
(setq symbols-outline-fetch-fn #'symbols-outline-lsp-fetch))
(setq symbols-outline-window-position 'left)
(symbols-outline-follow-mode))
Keybindings in the outline window
Key | Command | Description |
---|---|---|
g | symbols-outline-refresh | Refresh |
q | quit-window | Close the outline window |
n | symbols-outline-next | Go to the next symbol |
p | symbols-outline-prev | Go to the previous symbol |
f | symbols-outline-next-same-level | Go the the next symbol of the same level |
b | symbols-outline-prev-same-level | Go the the previous symbol of the same level |
u | symbols-outline-move-depth-up | Go the the parent symbol |
d | symbols-outline-move-depth-down | Go the the child symbol |
TAB | symbols-outline-toggle-node | Fold/unfold the children symbols |
S-TAB | symbols-outline-cycle-visibility-globally | Fold/unfold globally |
RET | symbols-outline-visit | Go to the symbol under cursor in the original buffer |
M-RET | symbols-outline-visit-and-quit | Go to the symbol under cursor in the original buffer and close the outline window |
Customizations
symbols-outline-window-position
: the outline window position. Defaultright
.symbols-outline-window-width
: the outline side window width. Default30
.symbols-outline-no-other-window
: ift
, the outline side window will not be selected with theother-window
command. Instead, you can switch to the outline window withsymbols-outline-show
. Defaultt
.symbols-outline-no-delete-other-window
: ift
, the outline side window will not be deleted by thedelete-other-windows
command. Defaultt
.symbols-outline-collapse-functions-on-startup
: whether to collapse function nodes on startup to hide the parameter nodes.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK