Giter Club home page Giter Club logo

nerdtree's Introduction

The NERDTree Vint

Introduction

The NERDTree is a file system explorer for the Vim editor. Using this plugin, users can visually browse complex directory hierarchies, quickly open files for reading or editing, and perform basic file system operations.

NERDTree Screenshot

Installation

Use your favorite plugin manager to install this plugin. tpope/vim-pathogen, VundleVim/Vundle.vim, junegunn/vim-plug, and Shougo/dein.vim are some of the more popular ones. A lengthy discussion of these and other managers can be found on vi.stackexchange.com. Basic instructions are provided below, but please be sure to read, understand, and follow all the safety rules that come with your power tools plugin manager.

If you have no favorite, or want to manage your plugins without 3rd-party dependencies, consider using Vim 8+ packages, as described in Greg Hurrell's excellent Youtube video: Vim screencast #75: Plugin managers.

Pathogen Pathogen is more of a runtime path manager than a plugin manager. You must clone the plugins' repositories yourself to a specific location, and Pathogen makes sure they are available in Vim.
  1. In the terminal,
    git clone https://github.com/preservim/nerdtree.git ~/.vim/bundle/nerdtree
  2. In your vimrc,
    call pathogen#infect()
    syntax on
    filetype plugin indent on
  3. Restart Vim, and run :helptags ~/.vim/bundle/nerdtree/doc/ or :Helptags.
Vundle
  1. Install Vundle, according to its instructions.
  2. Add the following text to your vimrc.
    call vundle#begin()
      Plugin 'preservim/nerdtree'
    call vundle#end()
  3. Restart Vim, and run the :PluginInstall statement to install your plugins.
Vim-Plug
  1. Install Vim-Plug, according to its instructions.
  2. Add the following text to your vimrc.
call plug#begin()
  Plug 'preservim/nerdtree'
call plug#end()
  1. Restart Vim, and run the :PlugInstall statement to install your plugins.
Dein
  1. Install Dein, according to its instructions.
  2. Add the following text to your vimrc.
    call dein#begin()
      call dein#add('preservim/nerdtree')
    call dein#end()
  3. Restart Vim, and run the :call dein#install() statement to install your plugins.
Vim 8+ packages

If you are using Vim version 8 or higher you can use its built-in package management; see :help packages for more information. Just run these commands in your terminal:

git clone https://github.com/preservim/nerdtree.git ~/.vim/pack/vendor/start/nerdtree
vim -u NONE -c "helptags ~/.vim/pack/vendor/start/nerdtree/doc" -c q

Getting Started

After installing NERDTree, the best way to learn it is to turn on the Quick Help. Open NERDTree with the :NERDTree command, and press ? to turn on the Quick Help, which will show you all the mappings and commands available in the NERDTree. Of course, your most complete source of information is the documentation: :help NERDTree.

NERDTree Plugins

NERDTree can be extended with custom mappings and functions using its built-in API. The details of this API are described in the included documentation. Several plugins have been written, and are available on Github for installation like any other plugin. The plugins in this list are maintained (or not) by their respective owners, and certain combinations may be incompatible.

If any others should be listed, mention them in an issue or pull request.

Frequently Asked Questions

In the answers to these questions, you will see code blocks that you can put in your vimrc file.

How can I map a specific key or shortcut to open NERDTree?

NERDTree doesn't create any shortcuts outside of the NERDTree window, so as not to overwrite any of your other shortcuts. Use the nnoremap command in your vimrc. You, of course, have many keys and NERDTree commands to choose from. Here are but a few examples.

nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>

How do I open NERDTree automatically when Vim starts?

Each code block below is slightly different, as described in the " Comment lines.

" Start NERDTree and leave the cursor in it.
autocmd VimEnter * NERDTree

" Start NERDTree and put the cursor back in the other window.
autocmd VimEnter * NERDTree | wincmd p

" Start NERDTree when Vim is started without file arguments.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif

" Start NERDTree. If a file is specified, move the cursor to its window.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif

" Start NERDTree, unless a file or session is specified, eg. vim -S session_file.vim.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') && v:this_session == '' | NERDTree | endif

" Start NERDTree when Vim starts with a directory argument.
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') |
    \ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif

How can I close Vim or a tab automatically when NERDTree is the last window?

" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif

" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif

How can I prevent other buffers replacing NERDTree in its window?

" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree.
autocmd BufEnter * if winnr() == winnr('h') && bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
    \ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif

Can I have the same NERDTree on every tab automatically?

" Open the existing NERDTree on each new tab.
autocmd BufWinEnter * if &buftype != 'quickfix' && getcmdwintype() == '' | silent NERDTreeMirror | endif

or change your NERDTree-launching shortcut key like so:

" Mirror the NERDTree before showing it. This makes it the same on all tabs.
nnoremap <C-n> :NERDTreeMirror<CR>:NERDTreeFocus<CR>

How can I change the default arrows?

let g:NERDTreeDirArrowExpandable = '?'
let g:NERDTreeDirArrowCollapsible = '?'

The preceding values are the non-Windows default arrow symbols. Setting these variables to empty strings will remove the arrows completely and shift the entire tree two character positions to the left. See :h NERDTreeDirArrowExpandable for more details.

How can I show lines of files?

let g:NERDTreeFileLines = 1

Lines in the file are displayed as shown below.

</pack/packer/start/nerdtree/
▸ autoload/
▸ doc/
▸ lib/
▸ nerdtree_plugin/
▸ plugin/
▸ syntax/
  _config.yml (1)
  CHANGELOG.md (307)
  LICENCE (13)
  README.markdown (234)
  screenshot.png (219)

Can NERDTree access remote files via scp or ftp?

Short answer: No, and there are no plans to add that functionality. However, Vim ships with a plugin that does just that. It's called netrw, and by adding the following lines to your .vimrc, you can use it to open files over the scp:, ftp:, or other protocols, while still using NERDTree for all local files. The function seamlessly makes the decision to open NERDTree or netrw, and other supported protocols can be added to the regular expression.

" Function to open the file or NERDTree or netrw.
"   Returns: 1 if either file explorer was opened; otherwise, 0.
function! s:OpenFileOrExplorer(...)
    if a:0 == 0 || a:1 == ''
        NERDTree
    elseif filereadable(a:1)
        execute 'edit '.a:1
        return 0
    elseif a:1 =~? '^\(scp\|ftp\)://' " Add other protocols as needed.
        execute 'Vexplore '.a:1
    elseif isdirectory(a:1)
        execute 'NERDTree '.a:1
    endif
    return 1
endfunction

" Auto commands to handle OS commandline arguments
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc()==1 && !exists('s:std_in') | if <SID>OpenFileOrExplorer(argv()[0]) | wincmd p | enew | wincmd p | endif | endif

" Command to call the OpenFileOrExplorer function.
command! -n=? -complete=file -bar Edit :call <SID>OpenFileOrExplorer('<args>')

" Command-mode abbreviation to replace the :edit Vim command.
cnoreabbrev e Edit

nerdtree's People

Contributors

actionshrimp avatar alerque avatar andrewradev avatar andreykozlov1984 avatar bouk avatar bubba-h57 avatar camthompson avatar cperl82 avatar czak avatar eugenij-w avatar ggicci avatar inecas avatar jason0x43 avatar juanibiapina avatar ku1ik avatar lifecrisis avatar mnussbaum avatar pendulm avatar philrunninger avatar pickrelated avatar przepompownia avatar rzvxa avatar scrooloose avatar skyblueee avatar skylerlipthay avatar stevedewald avatar vincenttsf avatar weynhamz avatar wincent avatar xuyuanp 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  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

nerdtree's Issues

GVIM cannot open a bookmark in a new tab or a splitted windows

GVIM cannot open a bookmark in a new tab or a splitted windows. I have an error (translated from french)
Error detected while scanning function 21_openInNewTab..17 :
E121: Undefined variable : bookmark
E15: Invalid expression : "tabedit " . bookmark.path.str({'format': 'Edit'})

Session file support

Is it possible to save the nerdtree state in the session file in order to be able to recover it on :source ?

File Marking and execution

Hey NERDTree huggers,

Great plugin! Love what you've done! There's one feature I'm really missing from netrw that I think would be a great addition to your plugin: the ability to mark multiple files and execute a command on them at once. In netrw this is done by the mf and mx commands, by the functions NetrwMarkFile(islocal, fname) and NetrwMarkFileExe(islocal). From taking a brief peek at the code this should be extremely do-able in NERDTree, and would be extremely useful. For example, say I'm working on NERDTree in my git repository and I want to add certain files. I could mark those files using a command (in different directories in my tree branch even) then use one command to add them all to git! A myriad of other possibilities awaits.

NERD-tree does not trigger WinEnter

For some reason when I open a file from NERD-tree, the WinEnter autocommands are not triggered. This can be checked with

au WinEnter * echo "entering"

and then opening a file from NERD-tree.
I think this is a bug, I know it breaks some of my stuff.

NERD Tree root line loses syntax colour when truncated (patch)

NERDTree version 4.1.0 loses the syntax colour for the line displaying the tree root directory if it is truncated, because the first character on the line becomes < rather than /. The following simple patch solves the problem:

3391a3392
> syn match treeCWD #^<.*$# " Match CWD line even when truncated

"setlocal bufhidden=delete" upsets NERDTreeToggle and causes "Undefined variable: b:treeShowHelp"

Hi,

I use NERDTree as my project files explorer and during the day open and close lots of source code files (in tabs).

By default when I close tab Vim leaves that file as a buffer. e.g. you can see it in buffers menu
As I am working with lots of files list of buffers grows very quick and becomes unmanageable.
So I use following line in my .vimrc to make sure that closed tabs do not leave buffers behind
autocmd BufEnter * setlocal bufhidden=delete

Unfortunately with this line NERDTreeToggle can be used to open NerdTree only once per session.
Once NERDTree is closed (with NERDTreeToggle or NERDTreeClose) further attempts to run NERDTreeToggle cause following error

======== error start ========

Error detected while processing function 18_toggle..18_renderView..18_dumpHelp:
line 2:
E121: Undefined variable: b:treeShowHelp
E15: Invalid expression: b:treeShowHelp ==# 1
Error detected while processing function 18_toggle..18_renderView:
line 18:
E121: Undefined variable: b:NERDTreeShowBookmarks
E15: Invalid expression: b:NERDTreeShowBookmarks
line 27:
E121: Undefined variable: b:NERDTreeRoot
E15: Invalid expression: b:NERDTreeRoot.path.str({'format': 'UI', 'truncateTo': winwidth(0)})
line 28:
E121: Undefined variable: header
E116: Invalid arguments for function setline
line 33:
E121: Undefined variable: b:NERDTreeRoot
E15: Invalid expression: b:NERDTreeRoot.renderToString()

======== error end ==========

To reproduce the problem

  • Add to your .vimrc
    autocmd BufEnter * setlocal bufhidden=delete
  • Close Vim
  • Open any file with vim
  • call NERDTreeToggle 3 times

:NERDTreeToggle

:NERDTreeToggle

:NERDTreeToggle

firs two calls (1st-open, 2nd-close) will succeed, but 3rd call will fail with the above error message

Environment:
Ubuntu 10.10 32bit
(G)Vim 7.2.330

NERD_tree_version = '4.1.0'

Bug: E121: Undefined Variable: children

With the latest 4.0 release of Nerd Tree with Vim 7.2.245 I keep getting the error:
Error detected while processing function NERDTreeAddMenuItem..41:
line 18:
E121: Undefined variable: children

Files with spaces in name give E172 when opened from NERDtree

When I navigate to a file within NERDtree that has a space in the name and then hit "enter" to open it, I get this error message:

Vim(edit):E172: Only one file name allowed: edit /Users/tpavlic/Documents/My Documents/@Research/cooperative_task_processing_TAC/cooperative_task_processing.tex

Because there is a space in "My Documents", NERDtree thinks the file is two files.

Navigation Between Opened Files

Hi! I know that maybe this isn't an issue. But I've been looking for support and some refference besides the docs.

Is there any way I can navigate between the opened files of NERDTree? Like Ctrl-Alt-PageUp and Ctrl-Alt-PageDown in gedit?

Thanks!

Problems with apostrophed usernames and $HOME paths on Windows

I hit an issue with setup of version 4.1.0 with Vim 7.2 on a Windows XP machine.

I have an Irish surname, O'Connor, and that noxious apostrophe had crept in during the account setup on a new PC. The result is in Vim my $HOME variable has an apostrophe in it.
(Weirdly I had never done this before in years of previous PC setups.)

The following NERDTree line fails in this situation:
call s:initVariable("g:NERDTreeBookmarksFile", expand('$HOME') . '/.NERDTreeBookmarks')

I verified this was the case by logging into a different user account - works fine.
I hacked around this locally by pointing to $VIMRUNTIME rather than $HOME in the line above.

E482: Can't create file ~/.vim/NERDTreeBookmarks

Hi. If I don't set
let NERDTreeBookmarksFile=
I can create bookmarks. But if I
let NERDTreeBookmarksFile='~/.vim/sessions/NERDTreeBookmarks'
I get an error when creating bookmarks:

Error detected while processing function 19_bookmarkNode..66..39:
line 12:
E482: Can't create file ~/.vim/NERDTreeBookmarks

Mirror the tree that the file was open from

Hi,

In vim I always have many different trees and when I open another file from a the tree I always have to choose which tree to mirror, but all I really need is to mirror the tree that I am opening the file from.

Is there a way of doing this?

If someone could guide me in the right direction I might take a stab at implementing it.

Thanks

[Feature Request] Open multiple files at once

I'd love to being able to open multiple files at once. This would work like this:
Use Visual Line Mode (Shift+V) to select the files you want to open
Press a key combination
All files selected are opened in background buffers

Up a dir terrible slow under Cygwin

Hi,

I'm trying to use NERDTree under a cygwin version of vim. It's working well except for the "up one dir" operation (U or u key mappings). It takes a lot to complete this operation, about 30 seconds or even more. Any ideas why?

VIM Environment:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 13 2010 16:16:21)
Compiled by alec@tia
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent -clientserver -clipboard
+cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope +cursorbind +cursorshape
+dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() -gettext -hangul_input -iconv +insert_expand +jumplist
+keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname
+mouse -mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm
+multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra -perl +persistent_undo
+postscript +printer +profile -python -python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs
+smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit
+virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11
-xfontset -xim -xsmp -xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation:
gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -I/usr/lib/ruby/1.8/i386-cygwin -DRUBY_VERSION=18
Linking: gcc -L. -L/usr/local/lib -o vim.exe -lm -lncurses -lruby

Cygwin envrionment:
$ uname -a
CYGWIN_NT-5.1 tia 1.7.7(0.230/5/3) 2010-08-31 09:58 i686 Cygwin

NERDTree version:
4.1.0

Thanks!

minor bookmark issue

Hi, if I set NERDTree to open bookmarks automatically and then also set NERDTree to start automatically (with the line "autocmd VimEnter * NERDTree" in my .vimrc) then the bookmarks do not open automatically. I have to hit Shift-B or manipulate the tree in some way to force a re-rendering, which then pops up the bookmarks. -A

Syntax highlight loss in nerdtree when opening fortran files

Hi!
I've stumbled upon this weird problem: NerdTree losses all coloring when opening any fortran file (be it F77, F90, F95, fixed form, free form). Syntax highlighting is ok in the buffer of the file proper, though. It does not happen with c, c++, python, perl, shell, tex or any other type of file that I have tested.

NERD tree loses mount directory on Ubuntu.

use "mount -t cifs //X.X.X.X/test ~/project/test -o uid=1000,gid=1000,username=guest" on Ubuntu.
Mount success and it works fine under shell using ls or edit any file in this directory, but under vim, the direcotry "test" is missing. The Ubuntu is installed as a virtual machine.

Error viewing directories with '[', ']' or both in their name

Using version 4.1.0 of NERDTree, if I have a directory with a single '[' or ']' in then I can see the contents of the directory in NERDTree but Vim shows 'Illegal file name' at the bottom of the screen (I forget what this bit is called, status bar?).

If I have a drectory with '[' and ']' in, say for instance "[1234]MyProject", NERDTree refuses to show any files or subdirectories for that directory.

This is NERDTree 4.1.0 and VIM - Vi IMproved 7.0

Thanks!

Matthew

Error when creating multiple nodes at once

When I open NERDTree and press "ma" to add a child node, I get the following error message when I try to create multiple non existing nodes at once, e.g /home/joe exists, my input is /home/joe/test/dir/ect/ory/:

Error detected while processing function 58_showMenu..99..116..NERDTreeAddNo
de:
line 18:
E716: Key not present in Dictionary: isOpen || !empty(parentNode.children)
E15: Invalid expression: parentNode.isOpen || !empty(parentNode.children)
Error detected while processing function 58_showMenu..99..116:
line 6:
E171: Missing :endif
Error detected while processing function 58_showMenu..99:
line 19:
E171: Missing :endif

Besides the error message it works fine for directories but file node can not be created. The message is: NERDTree: Node Not Created.

Function StartShell similar vtreeexplorer.

Hello,

In vtreeexplorer exist one option "S" that's StartShell, is possible join into terminal and exit back to vtreeexplorer (workspace).

It's possible implement this function in NerdTree?
Thanks.

Conflict with Neocomplcache

I updated NerdTree and Neocomplcache to latest version,
If use them at the same time, the neocomplcache can't pop up completion menu, but if I delete plugin/Nerd_Tree.vim, neocomplcache works well.

Could you please fix it?
Thanks

Menu Feature Broken On Mac?

When navigating the FS with NERDTree, if I hit m on any type of item (file, dir), I get the following errors:

Error detected while processing function 14_showMenu..30..31:
line 4:
E716: Key not present in Dictionary: menuItems)-1)
E116: Invalid arguments for function len(self.menuItems)-1)
E116: Invalid arguments for function range(0, len(self.menuItems)-1)
E15: Invalid expression: range(0, len(self.menuItems)-1)
Press ENTER or type command to continue

This happens both in Macvim and console vim on my mac. I'm using the latest version of NERDTree, checked out yesterday.

Highlight current buffer

Not an issue - more of a feature request.
Is it possible to have a command that highlights the currently open file in NERDTree?
A bit like the 'RevealBookmark' command, but it just uses the active buffer instead of a bookmark.

Changing directory doesn't work on Windows

With the latest code from git master I'm not able to change the current working directory (key mapping: NERDTree-cd) on Windows Vista. It get the error messag "could not change cwd". Option NERDTreeChDirMode set to a value other than 0 in my vimrc file isn't working too, which is probably related to the problem above.

If I change the line let dir = self.str({'format': 'Cd'}) on line 1805 inside function s:Path.changeToDir() to let dir = self.str() cd works again, so I think it has something to to with wrong escaping.

Filters for bookmarks

NERDtree will act as a really good project manager if we could keep some more info of a bookmark, like the file filters (NERDtreeIgnore) for ignoring .pycs etc of a project.

Cannot edit a file in another directory that contains spaces

if you are in directory /home/me and use NERDTree on a directory with spaces "/tmp/a directory with spaces/" then when pressing enter on a file in that directory, you cannot edit the file. If you are already in the directory with spaces then it works fine.

Quit when where is no active buffer

It would be great if there is no need to quit the NERD_tree* buffers to quit Vim.
Maybe this can be put into the NERDTree as an option?

I have created a small function to get this feature. Just put this code into your .vimrc:

function! NERDTreeQuit()
  redir => buffersoutput
  silent buffers
  redir END
"                     1BufNo  2Mods.     3File           4LineNo
  let pattern = '^\s*\(\d\+\)\(.....\) "\(.*\)"\s\+line \(\d\+\)$'
  let windowfound = 0

  for bline in split(buffersoutput, "\n")
    let m = matchlist(bline, pattern)

    if (len(m) > 0)
      if (m[2] =~ '..a..')
        let windowfound = 1
      endif
    endif
  endfor

  if (!windowfound)
    quitall
  endif
endfunction
autocmd WinEnter * call NERDTreeQuit()

Greetings
Michael

:NERDTreeMirror on the wrong side

I'm using the following in my .vimrc file:

autocmd VimEnter * NERDTree ~/Projects/
autocmd TabEnter * NERDTreeMirror

Unfortunately when a tab is created the NERDTree split is on the right side and large and the file is on the left side and is very slim, presumably their positions have been reversed. Is there any solution for this?

".. (up a dir)" fails on windows

When the ".. (up a dir)" selection is made on a Windows installation, it causes an InvalidArgument exception.

The exact error message is of the form:

Error detected while processing function 14_activateNode..14_upDir..114..120..122:
E605: Exception not caught: NERDTree.InvalidArgumentsError: Invalid path = [PATH OMITTED]

Problem with Custom NERDTreeBookmarks Location

Trying to specify a custom location for the NERDTreeBookmarks file by placing this in the .vimrc file:

let NERDTreeBookmarksFile="~/.vim/NERDTreeBookmarks"

and creating a bookmark ":Bookmark docrails" returns an error:

Error detected while processing function 18_bookmarkNode..51..24:
line 12:
E482: Can't create file ~/.vim/NERDTreeBookmarks

But I don't get an error if I remove the line and use the default location of $HOME./NERDTreeBookmarks

I've tested on Ubuntu 10.04, Vim 7.2 Included Patches 1-330, Nerdtree 4.1.0 stable and dev (as of issue creation date/time).

nerdtree breaks down custom status line

nerd tree changes statusline from the one that is set in .vimrc to some other setting (looks like default statusline in vim).
in my vimrc file i added "let g:NERDTreeStatusline = -1" but the problem persists.

Option to avoid that nerdtree takes the focus

Hi!, this isn't a true issue but a request for a feature, I think it'd be nice if nerdtree could have an option to control whether the cursor is moved to the nerdtree or remains in the "main" window from where it was called. Something like the taglist option Tlist_GainFocus_On_ToggleOpen.

Update Last Change date (or remove)

The NERD_tree.vim file says the last change date was 1 December 2009. It took me a while to see that there has actually been a lot of development since then.

NERDTree should follow vim directory

I have searched the docu and googled a bit, but i couldn't find a way that reloads the nerd tree every time I use :cd and switch a directory. The NERDTree dir should reload after I changed the directory for vim. Is this possible somehow?

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.