Sticky project dir
This commit is contained in:
parent
611ff17566
commit
714e3dfd58
1 changed files with 18 additions and 0 deletions
|
|
@ -53,6 +53,24 @@
|
|||
(save-selected-window
|
||||
(neotree-dir dir)))))
|
||||
|
||||
(defcustom theurgy-sticky-project-dir t
|
||||
"When true, this will persist any changes to the Neotree root when switching tabs."
|
||||
:type 'boolean
|
||||
:group 'theurgy
|
||||
:group 'theurgy-projects)
|
||||
|
||||
(defun theurgy-change-tab-dir ()
|
||||
"Change the tab directory to the one selected in neotree."
|
||||
(interactive)
|
||||
(tab-bar-change-tab-group
|
||||
(concat "project: "
|
||||
(save-selected-window
|
||||
(neotree)
|
||||
neo-buffer--start-node))))
|
||||
|
||||
(when theurgy-sticky-project-dir
|
||||
(advice-add 'neotree-change-root :after #'theurgy-change-tab-dir))
|
||||
|
||||
(defun theurgy-swap-to-tab-project ()
|
||||
"Go to the project dir of the tab group."
|
||||
(let ((tab-group-name (tab-bar-tab-group-default (tab-bar--current-tab))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue