Code Monkey home page Code Monkey logo

emacs-neotree's Introduction

emacs-neotree

A Emacs tree plugin like NerdTree for Vim.

Build Status MELPA Stable MELPA

Screenshots

NeoTree-1

Installation

Melpa

You can install the plugin using the packages on melpa.

Make sure you have something like the following in your Emacs startup file (~/.emacs.d/init.el, or ~/.emacs):

    (add-to-list 'package-archives
                 '("melpa" . "http://melpa.org/packages/"))

To make that take effect, either evaluate that elisp expression or restart Emacs.

Then use M-x package-list-packages, select neotree from the list by pressing i, then press x to execute the changes. At that point, the package will be installed.

Source

Clone project:

$ cd /some/path
$ git clone https://github.com/jaypei/emacs-neotree.git neotree
$ cd neotree
$ git checkout dev

Add config to emacs:

(add-to-list 'load-path "/some/path/neotree")
(require 'neotree)
(global-set-key [f8] 'neotree-toggle)

Open (toggle) NeoTree:

<F8>

Keybindings

Only in Neotree Buffer:

  • n next line, p previous line。
  • SPC or RET or TAB Open current item if it is a file. Fold/Unfold current item if it is a directory.
  • U Go up a directory
  • g Refresh
  • A Maximize/Minimize the NeoTree Window
  • H Toggle display hidden files
  • O Recursively open a directory
  • C-c C-n Create a file or create a directory if filename ends with a ‘/’
  • C-c C-d Delete a file or a directory.
  • C-c C-r Rename a file or a directory.
  • C-c C-c Change the root directory.
  • C-c C-p Copy a file or a directory.

Configurations

Theme config

NeoTree provides following themes: classic(default) ascii arrow icons nerd. Theme can be configed by setting neo-theme. For example, use icons for window system and arrow terminal.

(setq neo-theme (if (display-graphic-p) 'icons 'arrow))

Note: For users who want to use the icons theme. Pls make sure you have installed the all-the-icons package and its fonts.

  • all-the-icons theme screenshots

More documentation

EmacsWiki: En 中文版

emacs-neotree's People

Contributors

abdisalan avatar aborn avatar ahmadseleem avatar bmag avatar cipharius avatar conao3 avatar dchrzanowski avatar deb0ch avatar domtronn avatar duianto avatar f0086 avatar ichiroc avatar jaypei avatar jianingy avatar mosic avatar nixmaniack avatar palikar avatar purcell avatar rranelli avatar rzetterberg avatar shanavas786 avatar sumproxy avatar syl20bnr avatar syohex avatar takaxp avatar tchajed avatar vermiculus avatar vineethkartha avatar wakeful avatar xdev-x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs-neotree's Issues

Peep-mode

I would like to suggest a "Peep-mode" or some such thing similar to Sublime Text where you can get an instant preview of the file just by scrolling. See peep-dired for one such implementation. (N.B. for peep-dired the temporary buffers continue to hang around rather than being ephemeral like in Sublime Text.)

Just show the Project Dir name ?

Sometime, I don't like to see the full Path in NeoTree!!
Just the Project Direcory name is enough. And if I wanna see the full path I just do:
:!pwd

Most of the time we can't see the full path anyway, unless we make the NeoTree split very wide.

Briefly: it's nice to give me enough info within as less space as possible, right?

Play ball with popwin.

Neotree and popwin don't seem to get along. If neotree is open and successively a temporary buffer is opened with popwin, a new window with the neotree buffer is displayed side by side next to the first one. Ideally only one neotree window should be displayed no matter how many buffers are opened with popwin.

"Up a dir"

Hi,

and it would be nice to have ".." bound to a keybinding in neotree, that is, pressing (say) ^ goes up a dir. Without the user having to scroll to and "selecting" the .. entry.

Thanks,
Joerg

Open file in last active window

If you have more windows A, B, C in the same frame and you open neotree from within a certain window A and then select a file and open it, the file will not necessarily be opened in the original window A but might be opened in window B or C. It would be nice if the file was opened in the last focused window just like NERDTree for vim does.

Add option to open tree at directory root

Hi,

I have been using dirtree for quite some time, but after seeing neotree I had to change. neotree is WAAAAAAAY better.

I have made a function to open the tree widget right at the project root given by the find-file-in-project package. What about adding this feature to neotree ?

Update neotree working dir if called again

Hi,

if i open neotree from some buffer for the first time, it shows the directory that fits to the buffer. Fine.
If i now switch to another buffer for a file in some other dir and get neotree up again, it shows the old directory instead of updating.

Killing the neotree buffer instead of "toggling" it helps, then it ends in the right place.
But it would be nice if it (probably customizable) could just always refresh the dir on toggle.

Thanks,
Joerg

issues with neo-dont-be-alone

neo-dont-be-alone seems to have several issues.
For example, the neotree-toggle command won't work when the var is set to t. This seems to also affect other commands such as neotree-hide.

Opening Files/Windows not splitting right

If i have opened only the scratch buffer and the NeoTree window on the left and open a file from it, the "right" window with the scratch buffer is not reused. Instead the window is split horizontally and the file is opened at the bottom. Is there a way to use the last active window to open the new file? In my case replace the scratch window with the file i opened from the NeoTree window?

Hide certain file types

This is a feature request rather than a bug. It would be nice if we could customize neotree to hide certain file extensions, such as .class for java or .pyc for python, etc. It gets cluttered when there are unwanted files.

Update: Just realized neotree hides pyc files automatically. Should of checked that first :p

Some suggesstion for enhancement

I think some small functions would make Neotree more convenient for using:

  1. find-file at the node. That is, find-file with the var default-directory set to current node, which let user be able to open the directory node with dired-mode directly, or open a new file under the directory node. (I have to say C-c C-n is too inconvenient and against instinct. How about bind + to mkdir with the current node's path set as default-directory?)
  2. hide unnecessary items (e.g. #*#, *~)

Automatically open single child folder

Probably it's already been implemented and i don't know of it, but i'd like to see the behaviour like github has, i.e when i have structure a/b/c/d/file, and there are no other folders/files in a,b,c, neotree would automatically open these folders. I've tried to modify neotree-enter function, but couldn't get it working.

Add emacs-neotree to MELPA or Marmalade

It'd be nice to see neotree installation via package.el,

For example, the MELPA recipe would simply be:

(emacs-neotree 
  :fetcher github 
  :repo "jaypei/emacs-neotree")

Note that MELPA will propagate the master branch, so depending on your release strategy, you could either use alternative branches for your bleeding edge releases, or specify the :branch parameter in the recipe, ie.

(emacs-neotree 
  :fetcher github 
  :repo "jaypei/emacs-neotree"
  :branch "stable")

(assuming a stable release is on origin/stable)

You can fork MELPA and add your package recipe, via a pull request.

funcall: Wrong type argument: window-live-p, nil

I get this when trying to toggle neo-tree

Debugger entered--Lisp error: (wrong-type-argument window-live-p nil)
  #<subr select-window>(nil nil)
  funcall(#<subr select-window> nil nil)
  (with-no-warnings (funcall ad--addoit-function window norecord))
  (setq ad-return-value (with-no-warnings (funcall ad--addoit-function window norecord)))
  (let (ad-return-value) (setq ad-return-value (with-no-warnings (funcall ad--addoit-function window norecord))) (powerline-set-selected-window) ad-return-value)
  ad-Advice-select-window(#<subr select-window> nil)
  apply(ad-Advice-select-window #<subr select-window> nil)
  select-window(nil)
  (let ((window nil) (buffer (neo-global--get-buffer))) (select-window (neo-global--get-first-window)) (split-window-horizontally) (setq window (selected-window)) (neo-window--init window buffer) (setq neo-global--window window) (select-window (window-right (get-buffer-window))) window)
  neo-global--create-window()
  (setq neo-global--window (neo-global--create-window))
  (progn (setq neo-global--window (neo-global--create-window)))
  (if (and (null neo-global--window) auto-create-p) (progn (setq neo-global--window (neo-global--create-window))))
  neo-global--get-window(t)
  (progn (neo-global--get-window t) (let ((wconfig (current-window-configuration))) (unwind-protect (progn (let ((rlt nil)) (switch-to-buffer (neo-global--get-buffer)) (setq buffer-read-only nil) (setq rlt (progn (let ... ... ...) (neo-buffer--save-cursor-pos path nil) (neo-buffer--refresh nil))) (setq buffer-read-only t) rlt)) (set-window-configuration wconfig))))
  (if (and (file-exists-p path) (file-directory-p path)) (progn (neo-global--get-window t) (let ((wconfig (current-window-configuration))) (unwind-protect (progn (let ((rlt nil)) (switch-to-buffer (neo-global--get-buffer)) (setq buffer-read-only nil) (setq rlt (progn ... ... ...)) (setq buffer-read-only t) rlt)) (set-window-configuration wconfig)))))
  neotree-dir("/Users/cezar/Sites/project/")
  (if (not valid-start-node-p) (neotree-dir (neo-path--get-working-dir)) (neo-global--get-window t))
  (let ((valid-start-node-p nil)) (let ((wconfig (current-window-configuration))) (unwind-protect (progn (let ((rlt nil)) (switch-to-buffer (neo-global--get-buffer)) (setq buffer-read-only nil) (setq rlt (progn (setq valid-start-node-p ...))) (setq buffer-read-only t) rlt)) (set-window-configuration wconfig))) (if (not valid-start-node-p) (neotree-dir (neo-path--get-working-dir)) (neo-global--get-window t)))
  neotree-show()
  (if (neo-global--window-exists-p) (neotree-hide) (neotree-show))
  neotree-toggle()
  call-interactively(neotree-toggle nil nil)
  command-execute(neotree-toggle)

Let the ModeLine grow

If I enable neotree, the content below the modeline can't be bigger than 1 line. This happens for me with various plugins like the ido-vertical-mode. So If I press M-x or
C-x C-f, only one line is displayed. I think the neotree is comsuming the whole width and is unable to shrink.

2014-06-08-232609_442x320_scrot

2014-06-08-232702_435x149_scrot

Regression: clicking neotree directories does not open

In the latest version on Melpa (neotree-20150322.518), clicking on directories in neotree does not expand/contract them, but produces the error Buffer is read-only: #<buffer *NeoTree*>.

(Expanding directories via on the keyboard still works as usual.)

Customize neotree placement

Typically, I reserve the left side of buffers for text editing, and place less important things on the right hand side. Is there a way to tell neotree to open on the right instead of the left? Could not find any customization options to accomplish this.

Which font are you using in the screenshot, by the way?

I like the font in the screenshot:

Could you tell me which font you use? I looked into your Emacs configuration, but the lines:

(setq cn-name (if *is-a-mac* "STHeiti" "STHeiti"))
(setq en-name (if *is-a-mac* "Inconsolata" "Ubuntu Mono"))

Don't correspond with the font used in the screenshot.

Thanks in advance for your reply.

delete-other-window causes error with popwin and ido

I have to set neo-persist-show to nil to disable (defadvice delete-other-windows ...
I have ido and popwin enabled.

With that configuration, when I hit TAB in the minibuffer, ido-complete is called, which in turn calls ido-completion-help if there are multiple completion items to be shown.

That triggers popwin, which calls delete-other-windows and there, if the defadvice set in this package is active (if neo-persist-show is t), then I get the elisp error "Attempt to delete minibuffer or sole ordinary window".

Can you please fix the defadvice so that it doesn't try to delete the minibuffer window?

hooking neotree to another mode

I'm hooking neotree like this:

(add-hook 'go-mode-hook 'neotree)
(add-hook 'php-mode-hook 'neotree)

But when neotree appears for first time emacs forgets to switch to the opened file buffer, I have to switch to it manually or select it again from neotree.

I'm doing something wrong?

Java packages support

Is there a method to visualize Java packages like this:

|-- org.something.controller
|    |-- source.java
|    |-- anotherSource.java

not like:

|-- org
|    |-- something
|    |   |-- controller
|    |   |     |-- source.java
|    |   |     |-- anotherSource.java

?

Bug with helm : Attempt to delete minibuffer or sole ordinary windows

This is a weird bug and may happen because of something else on my config (don't see why it would, but then again I don't see how neotree does this).

After opening say helm-mini, trying to open helm help (with "C-c ?") gives the following error : Attempt to delete minibuffer or sole ordinary windows

I have these two lines on my config (and when I comment them the bug goes away) :
(add-to-list 'load-path (concat user-emacs-directory "/vendor/neotree"))
(require 'neotree)

fixed - small - independent - font-size ?

I really like to this to go to the next level Visually:

How about trying to make it like the sidebar of textmate; where the list of the file have their own
font-size and the font is small because it helps make the file names less trimmed.

What you guys think ?

Hide certain file extensions

It would be great if there where a blacklist of extensions (configured per customize) which will not be visible in the tree. Files I am thinking of:

  • *.elc
  • Dotfiles
  • *.o
  • *.zip

Rename/Move files and directories

NerdTree has a handy feature to rename/move folders and files. I used this feature extremely often, so I think this is a missing key feature. neotree already can create and delete files and folders, so renaming/moving (technically the same feature) should be implemented.

`neotree-show` and `neotree-toggle` don't focus Neotree buffer

Both neotree-show and neotree-toggle open Neotree, but leave the point focused on the current window, rather than moving the point to the Neotree buffer.

Expected behavior would be to focus the point in the newly-opened Neotree buffer. See: Calc, Calendar,Info,Speedbar` and others for examples.

Invalid function: neo-buffer--save-excursion

Hi! I just installed this plugin today, but when issuing the neotree-toggle command, I get an error, as shown in the title.

Is this a problem on my end or a bug in the project?

Add bookmarks similar to what Nerdtree has

First of all - thank you for making this plugin for us! NerdTree was one of the things I missed when I switched from vim to emacs; I was really happy to see that you provided a similar useful plugin.

It's got everything I loved about NerdTree, except... no bookmarks. In Nerdtree, you could call :Bookmark on any node to have it added to a bookmark list, that you could call with Shift-B. This allows you to quickly jump to commonly used folders. It would be lovely to see something similar in Neotree!

window always on the right

For some reason the neotree window always appears on the right, any idea why that might be happening.

1.0

ChangeLog:

  • Better menu display, similar press m in NerdTree;
  • More file operations, create/delete/move/rename;
  • Fix cursor bugs

Pressing 'q' in Neotree leaves orphaned window

Idiomatic use of 'q' usually buries the buffer (see Calendar, Info and Calc for examples). In Neotree, it is bound to quit-window, which has the side-effect of not actually calling delete-window, which is expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.