emacs-neotree icon indicating copy to clipboard operation
emacs-neotree copied to clipboard

Multiple tree (multiple buffer) support?

Open xpe opened this issue 10 years ago • 12 comments

I'd like to have multiple instantiations of neotree, in the same way that you can have multiple dired buffers.

Is this possible with the current code? If not, how much change would you think is needed, and would you be open to a patch?

I think this would help drive compatibility with workgroups; e.g. https://github.com/pashinin/workgroups2.

xpe avatar Nov 13 '14 04:11 xpe

I am about to try out neo-buffer--create.

xpe avatar Nov 13 '14 04:11 xpe

Multiple instance is currently not supported. If you want to hack it, you can focus on those functions with a prefix of "neo-global-". I thinks it is not easy.

Do you think let NeoTree single instance to support multiple projects is a good idea?

jaypei avatar Nov 16 '14 05:11 jaypei

neotree should support multiple projects.

gamead avatar Dec 31 '14 09:12 gamead

Projectile + helm is a good practice. A few days ago I made a simple integration with Projectile, it can be used like this:

;; put this into your emacs dotfile
(setq projectile-switch-project-action 'neotree-projectile-action)

;; then
C-c p p <select project> RET

If you have any idea, please tell me :)

jaypei avatar Dec 31 '14 15:12 jaypei

This would be an awesome feature!

bitops avatar Mar 21 '15 20:03 bitops

@jaypei Sure you can switch between projects like this but the buffers do not change,they are not isolated.You are in project one,work on some files,switch to project two and you still have project one's buffers active.Using layouts in spacemacs is not an option either,Neotree does not work with them. https://github.com/syl20bnr/spacemacs/issues/5696

kabasakalis avatar Apr 05 '16 22:04 kabasakalis

@jaypei That works super well for me. Thanks for the post!

howdoicomputer avatar Apr 14 '16 22:04 howdoicomputer

Is this really still not a feature? I often have multiple Emacs windows attached to the same daemon and I can't have more than one instance of neotree. Pretty lame.

isaacjwilliams avatar Mar 19 '20 15:03 isaacjwilliams

@fomentia Yeah, I too would like to have this feature.

realchonk avatar Feb 02 '22 14:02 realchonk

Seems like the projects is not under maintenance anymore, I'm about to fork the project and begin a combo of fixes + new features (particularly this one of multiple buffers since I'm pretty used to at having multiple frames and one daemon). Dunno know if I'm gonna have full time to do this but if someone want to help every code/doc add/fix/suggestion will be welcomed.

Edit the fork is: https://github.com/aalher/treeninja

aalher avatar May 03 '23 18:05 aalher

@aalher I've recently taken up maintenance! I'd be happy to help out getting this in

Abdisalan avatar Jul 30 '23 20:07 Abdisalan

@Abdisalan I've been using Neotree for many years now and it's great. Only thing I wish for is the ability to have it work with multiple emacs sessions. I use emacs daemon and have a couple sessions going at once (per project). When I switch sessions I have to kill the current neotree buffer and start a new one with this function:

(defun neotree-project-dir-toggle ()
  "Open NeoTree using the project root, using find-file-in-project,
or the current buffer directory."
  (interactive)
  (let ((project-dir
         (ignore-errors
           (projectile-project-root)
           ))
        (file-name (buffer-file-name))
        (neo-smart-open t))
    (if (and (fboundp 'neo-global--window-exists-p)
             (neo-global--window-exists-p))
        (neotree-hide)
      (progn
        (neotree-show)
        (if project-dir
            (neotree-dir project-dir))
        (if file-name
            (neotree-find file-name))))))

Would be awesome if I could just switch projects and have neotree buffers stick for each project. Thanks for your help!

mattsears avatar Jan 24 '24 17:01 mattsears