Emacs. Пакет treemacs

2025-01-20 · 5 мин. для прочтения

Emacs. Пакет treemacs.

Содержание

1 Общая информация

  • Репозиториий: https://github.com/Alexander-Miller/treemacs
  • Предоставляет интерфейс для работы с файловой системой и проектами.
  • Позволяет организовать файлы и папки в виде дерева, что упрощает навигацию и управление проектами.

2 Комбинации клавиатурные

2.1 Настраиваемые

2.2 Project (префикс C-c C-p)

СочетаниеФункцияОписание
C-c C-p atreemacs-add-project-to-workspaceSelect a new project to add to the treemacs workspace.
C-c C-p ptreemacs-projectileSelect a projectile project to add to the workspace.
C-c C-p dtreemacs-remove-project-from-workspaceRemove project at point from the workspace.
C-c C-p rtreemacs-rename-projectRename project at point.
C-c C-p c ctreemacs-collapse-projectCollapse project at point.
C-c C-p c o / S-TABtreemacs-collapse-all-projectsCollapse all projects.
C-c C-p c otreemacs-collapse-all-projectsCollapse all projects except the project at point.

2.3 Workspaces Keybinds (префикс C-c C-w)

СочетаниеФункцияОписание
C-c C-w rtreemacs-rename-workspaceRename a workspace.
C-c C-w atreemacs-create-workspaceCreate a new workspace.
C-c C-w dtreemacs-remove-workspaceDelete a workspace.
C-c C-w streemacs-switch-workspaceSwitch the current workspace.
C-c C-w etreemacs-edit-workspacesEdit workspace layout via org-mode.
C-c C-w ntreemacs-next-workspaceSwitch to the next workspace.
C-c C-w ftreemacs-set-fallback-workspaceSelect the default fallback workspace.

2.4 Node Visit Keybinds (префикс o)

СочетаниеФункцияОписание
ovtreemacs-visit-node-vertical-splitOpen current file or tag by vertically splitting next-window .
ohtreemacs-visit-node-horizontal-splitOpen current file or tag by horizontally splitting next-window .
oo / RETtreemacs-visit-node-no-splitOpen current file or tag, performing no split and using next-window directly.
octreemacs-visit-node-close-treemacsOpen current file or tag, performing no split and using next-window directly, and close treemacs.
oaatreemacs-visit-node-aceOpen current file or tag, using ace-window to decide which window to open the file in.
oahtreemacs-visit-node-ace-horizontal-splitOpen current file or tag by horizontally splitting a window selected by ace-window.
oavtreemacs-visit-node-ace-vertical-splitOpen current file or tag by vertically splitting a window selected by ace-window.
ortreemacs-visit-node-in-most-recently-used-windowOpen current file or tag in the most recently used window.
oxtreemacs-visit-node-in-external-applicationOpen current file according to its mime type in an external application. Linux, Windows and Mac are supported.

2.5 Toggle Keybinds (префикс t)

СочетаниеФункцияОписание
thtreemacs-toggle-show-dotfilesToggle the hiding and displaying of dotfiles.
titreemacs-hide-gitignored-files-modeToggle the hiding and displaying of gitignored files.
twtreemacs-toggle-fixed-widthToggle whether the treemacs window should have a fixed width. See also treemacs-width.
tftreemacs-follow-modeToggle treemacs-follow-mode .
tatreemacs-filewatch-modeToggle treemacs-filewatch-mode .
tvtreemacs-fringe-indicator-modeToggle treemacs-fringe-indicator-mode .
tdtreemacs-git-commit-diff-modeToggle treemacs-git-commit-diff-mode .

2.6 Copy Keybinds (префикс y)

СочетаниеФункцияОписание
yatreemacs-copy-absolute-path-at-pointCopy the absolute path of the node at point.
yrtreemacs-copy-relative-path-at-pointCopy the path of the node at point relative to the project root.
yptreemacs-copy-project-path-at-pointCopy the absolute path of the project root for the node at point.
yntreemacs-copy-filename-at-pointCopy the filename for the node at point.
yftreemacs-copy-fileCopy the file at point.

2.7 Общие сочетания

СочетаниеФункцияОписание
?treemacs-common-helpful-hydraSummon a helpful hydra to show you treemacs’ most commonly used keybinds.
C-?treemacs-advanced-helpful-hydraSummon a helpful hydra to show you treemacs’ rarely used, advanced keybinds.
ntreemacs-next-lineGo to the next line.
ptreemacs-previous-lineGo to the previous line.
M-J/Ntreemacs-next-line-other-windowGo to the next line in next-window .
M-K/Ptreemacs-previous-line-other-windowGo to the previous line in next-window ..
<PgUp>treemacs-next-page-other-windowGo to the next page in next-window .
<PgDn>treemacs-previous-page-other-windowGo to the previous page in next-window ..
M-j/M-ntreemacs-next-neighbourGo to the next same-level neighbour of the current node.
M-k / M-ptreemacs-previous-neighbourGo to the previous same-level neighbour of the current node.
utreemacs-goto-parent-nodeGo to parent of node at point, if possible.
<M-Up>treemacs-move-project-upSwitch positions of project at point and the one above it.
<M-Down>treemacs-move-project-downSwitch positions of project at point and the one below it.
wtreemacs-set-widthSet a new value for the width of the treemacs window.
<treemacs-decrement-widthDecrease the width of the treemacs window.
>treemacs-increment-widthIncrease the width of the treemacs window.
RETtreemacs-RET-actionRun the action defined in treemacs-RET-actions-config for the current node.
TABtreemacs-TAB-actionRun the action defined in treemacs-TAB-actions-config for the current node.
g/r/grtreemacs-refreshRefresh the project at point.
dtreemacs-delete-fileDelete node at point.
Rtreemacs-rename-fileRename node at point.
cftreemacs-create-fileCreate a file.
cdtreemacs-create-dirCreate a directory.
qtreemacs-quitHide the treemacs window.
Qtreemacs-kill-bufferDelete the treemacs buffer.
Ptreemacs-peek-modePeek at the files at point without fully opening them.
yatreemacs-copy-absolute-path-at-pointCopy the absolute path of the node at point.
yrtreemacs-copy-relative-path-at-pointCopy the path of the node at point relative to the project root.
yptreemacs-copy-project-path-at-pointCopy the absolute path of the project root for the node at point.
yftreemacs-copy-fileCopy the file at point.
mtreemacs-move-fileMove the file at point.
streemacs-resortSet a new value for treemacs-sorting .
btreemacs-add-bookmarkBookmark the currently selected files’s, dir’s or tag’s location.
h/M-htreemacs-COLLAPSE-actionRun the action defined in treemacs-COLLAPSE-actions-config for the current node.
l/M-ltreemacs-RET-actionRun the action defined in treemacs-RET-actions-config for the current node.
M-Htreemacs-root-upMove treemacs’ root one level upward. Only works with a single project in the workspace.
M-Ltreemacs-root-downMove treemacs’ root into the directory at point. Only works with a single project in the workspace.
Htreemacs-collapse-parent-nodeCollapse the parent of the node at point.
!treemacs-run-shell-command-for-current-nodeRun an asynchronous shell command on the current node, replacing “$path” with its path.
M-!treemacs-run-shell-command-in-project-rootRun an asynchronous shell command in the root of the current project, replacing “$path” with its path.
Ctreemacs-cleanup-litterClose all directories matching any of treemacs-litter-directories .
=treemacs-fit-window-widthAdjust the width of the treemacs window to that of the longsest line.
Wtreemacs-extra-wide-toggleToggle between normal and extra wide display for the treemacs window.
Дмитрий Сергеевич Кулябов
Authors
Профессор кафедры теории вероятностей и кибербезопасности
Мои научные интересы включают физику, администрирование Unix и сетей.