mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 11:43:03 +03:00
feat(emacs): treemacs-perspective
This commit is contained in:
parent
f92bd16c50
commit
48fd28b543
2 changed files with 38 additions and 1 deletions
|
|
@ -484,6 +484,12 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
|
|||
:after (treemacs magit)
|
||||
:straight t)
|
||||
|
||||
(use-package treemacs-perspective
|
||||
:after (treemacs perspective)
|
||||
:straight t
|
||||
:config
|
||||
(treemacs-set-scope-type 'Perspectives))
|
||||
|
||||
(general-define-key
|
||||
:keymaps '(normal override global)
|
||||
"C-n" 'treemacs)
|
||||
|
|
|
|||
33
Emacs.org
33
Emacs.org
|
|
@ -1003,7 +1003,7 @@ Config for the Helm incremental completion framework. I switched to Ivy some tim
|
|||
** Treemacs
|
||||
[[https://github.com/Alexander-Miller/treemacs][Treemacs]] calls itself a tree layout file explorer, but looks more like a project and workspace management system.
|
||||
|
||||
Integrates with evil, magit and projectile.
|
||||
Integrates with evil, magit, projectile and perspective. The latter is particularly great - each perspective can have its own treemacs workspace!
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package treemacs
|
||||
|
|
@ -1025,6 +1025,12 @@ Integrates with evil, magit and projectile.
|
|||
:after (treemacs magit)
|
||||
:straight t)
|
||||
|
||||
(use-package treemacs-perspective
|
||||
:after (treemacs perspective)
|
||||
:straight t
|
||||
:config
|
||||
(treemacs-set-scope-type 'Perspectives))
|
||||
|
||||
(general-define-key
|
||||
:keymaps '(normal override global)
|
||||
"C-n" 'treemacs)
|
||||
|
|
@ -1060,6 +1066,31 @@ Function to open dired and vterm at given nodes.
|
|||
"gt" 'my/treemacs-open-vterm
|
||||
"`" 'my/treemacs-open-vterm))
|
||||
#+end_src
|
||||
|
||||
Also a function to open a file from all treemacs projects.
|
||||
#+begin_src emacs-lisp
|
||||
(defun my/get-treemacs-workspace-file-alist ()
|
||||
(apply
|
||||
#'append
|
||||
(mapcar
|
||||
(lambda (project)
|
||||
(let* ((path (treemacs-project->path project))
|
||||
(name (projectile-project-name path)))
|
||||
(mapcar (lambda (file) (cons
|
||||
(format "[%s] %s" name file)
|
||||
(concat path "/" file)))
|
||||
(projectile-project-files path))))
|
||||
(treemacs-workspace->projects
|
||||
(treemacs-current-workspace)))))
|
||||
|
||||
(defun my/treemacs-open-file-in-all-workspaces ()
|
||||
(interactive)
|
||||
(find-file
|
||||
(let* ((files (my/get-treemacs-workspace-file-alist)))
|
||||
(cdr (assoc
|
||||
(completing-read "Files: " files nil t)
|
||||
files)))))
|
||||
#+end_src
|
||||
** Projectile
|
||||
[[https://github.com/bbatsov/projectile][Projectile]] gives a bunch of useful functions for managing projects, like finding files within a project, fuzzy-find, replace, etc.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue