jaypei / emacs-neotree

A emacs tree plugin like NerdTree for Vim.
GNU General Public License v3.0
1.56k stars 147 forks source link

Multiple tree (multiple buffer) support? #57

Open xpe opened 9 years ago

xpe commented 9 years ago

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 commented 9 years ago

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

jaypei commented 9 years ago

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?

gamead commented 9 years ago

neotree should support multiple projects.

jaypei commented 9 years ago

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 :)

bitops commented 9 years ago

This would be an awesome feature!

kabasakalis commented 8 years ago

@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

howdoicomputer commented 8 years ago

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

isaacjwilliams commented 4 years ago

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.

realchonk commented 2 years ago

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

aalher commented 1 year ago

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

Abdisalan commented 1 year ago

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

mattsears commented 8 months ago

@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!