49 votes
Accepted

How do I open and close NERDTree (toggle NERDTree view) using a single keystroke?

In your vimrc add nmap <F6> :NERDTreeToggle<CR> where <F6> is the key you want to map.
user avatar
  • 616
33 votes
Accepted

How to install NERDTree with Vundle?

Below is the empty Vundle config. set nocompatible filetype off " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " let Vundle manage ...
user avatar
  • 786
30 votes
Accepted

How do I change the default size of plugin window (NerdTree, Taglist, etc)?

The examples below set the width to 60 columns. Adjust to your preferences. NERDTree NERDTree uses a variable for just this: :let g:NERDTreeWinSize=60 This will set the width to 60. You can put ...
user avatar
  • 8,072
24 votes

How do I open and close NERDTree (toggle NERDTree view) using a single keystroke?

To open NerdTree : :NERDTreeFocus To switch beetween nerdtree and file opened windows : ctrl + ww (double w) or ctrl + w + (h/j/k/l) To close NerdTree (in nerdtree window) : :q
user avatar
13 votes
Accepted

Refresh files in NERDTree?

The NERD tree quick help is accessible from the NERD tree window by typing ? There I read: " Filesystem mappings~ ... " r: refresh cursor dir " R: refresh current root These should do what ...
user avatar
  • 3,169
11 votes
Accepted

Summary of functions in current file?

You could try either TagList or TagBar but such a list could be generated as needed (no third party tool or configuration needed) with a simple: :g/func/# See :help :global. If you don't mind a ...
user avatar
  • 33.1k
9 votes
Accepted

Change buffer focus on enter?

You can change your autocommand to execute <c-w>w after executing NERDTree. To do so you can use wincmd which is the equivalent of pressing <C-w> but with a command (see :h :wincmd) ...
user avatar
  • 46.5k
8 votes

Stop CtrlP from opening in NERDTree

Finally found a way to do this that doesn't involve closing NERDTree all the time. I made a function that cycles through the open windows until it finds a writable buffer, then runs ctrl-p there: ...
user avatar
7 votes
Accepted

Start NERDTree when gVim starts empty

The list of filename arguments can be obtained by calling argv(), so you could put something like this in your ~/.vimrc: if empty(argv()) NERDTree endif Note that putting a command in your ~/....
user avatar
  • 5,934
6 votes

How do I open and close NERDTree (toggle NERDTree view) using a single keystroke?

This would do exactly what you've asked for: nnoremap <silent> <expr> <F6> g:NERDTree.IsOpen() ? "\:NERDTreeClose<CR>" : bufexists(expand('%')) ? "\:NERDTreeFind<CR>" : "...
user avatar
  • 161
6 votes

navigate within nerdtree

I usually use a combination of j and the / search (with the incsearch setting enabled) to jump to where I want to be. In your example, I probably would have done something like /hello<enter><...
user avatar
  • 1,050
6 votes
Accepted

cannot install NerdTree pluging with Vundle

Spelling is the issue. Plugin 'scroolosse/nerdTree' Should be Plugin 'scrooloose/nerdTree' The double s is the clincher. GitHub Scrooloose NerdTree repo
user avatar
  • 571
6 votes

How to execute xdg-open from NERDTree in Linux?

For those curious, if NerdTree can xdg-open: Yes it can. Put the cursor on the desired file. Press m for the context menu. Press o to open in the system editor. Enjoy.
user avatar
  • 61
5 votes
Accepted

NERDTree How to open a file and automatically close the explorer buffer

As the question doesn't seem to generate a lot of answer I'll just answer it with the suggestion of @muru which is what I have used for a week before I switched to the netrw explorer. (Of course if a ...
user avatar
  • 46.5k
5 votes
Accepted

Disable Lightline on Nerdtree

It's a hack, but you could try this: augroup filetype_nerdtree au! au FileType nerdtree call s:disable_lightline_on_nerdtree() au WinEnter,BufWinEnter,TabEnter * call s:...
user avatar
  • 5,517
4 votes

Stop CtrlP from opening in NERDTree

I've tripped on this one too many times too: I've solved it by remapping the <c-p> to closing NERDTree (if open) and then opening CtrlP. Put this in your .vimrc: let g:ctrlp_map = '' ...
user avatar
  • 141
4 votes
Accepted

sourcing .vimrc file put square brackets around file icons

Putting this in your vimrc should fix the re-source issue: " after a re-source, fix syntax matching issues (concealing brackets): if exists('g:loaded_webdevicons') call webdevicons#refresh() ...
user avatar
4 votes
Accepted

A side pane file explorer that can list files by modification dates?

If you use the netrw plugin (which is included by default in recent versions), you can sort by date. Start netrw with the command :Ex (or :Vex to make it open as vertical split or "side pane" as you ...
user avatar
  • 7,466
4 votes

How to set up NERDTree to CD to current folder when opening it for the first time via :NERDTreeFind

Use :set autochdir command to change the current directory. It will set the working directory as specific to the opened file.
user avatar
4 votes

How do I change the default size of plugin window (NerdTree, Taglist, etc)?

I have this problem all the time with splits not being tall enough so I've added this key binding to my .vimrc: " open the current split all the way map <c-o> :res 100<CR> You can adapt ...
user avatar
  • 71
4 votes
Accepted

Prevent NERDTree from switching tabs when opening a file node?

There is currently no way to do this. From the source code (ref. lib/nerdtree/opener.vim line 238): function! s:Opener._openFile() if self._reuse && self._reuseWindow() return ...
user avatar
  • 13.8k
4 votes
Accepted

Close all windows except the current one and NERDTree

This solution only works with vim 8+ You can add this to your .vimrc: function! OnlyAndNerdtree() let currentWindowID = win_getid() windo if win_getid() != currentWindowID && &...
user avatar
  • 46.5k
4 votes
Accepted

how to split panes (vertically and horizontally) straight from nerdree

The linked question asks how to jump directly from File 3 window to NERDTree window without hopping through File 1 or File 2 window first. The OP's solution is to use the mouse to click on the ...
user avatar
  • 18.4k
4 votes
Accepted

Execute a file from nerdTree

In NERDTree, press m to bring up the NERDTree Menu, and then you should see an option, labeled o, to open the current node with the system editor associated with that file or directory. If that doesn'...
user avatar
  • 371
4 votes
Accepted

NERDTreeMenu Remapping

if you look at the documentation (:help NERDTree-t), you'll see that each of the command have a name and a default key. To remap for example NERDTreeMapUpdir to the 'a' key, you just have to add to ...
user avatar
  • 256
3 votes

How to set up NERDTree to CD to current folder when opening it for the first time via :NERDTreeFind

From the documention it would seem that it should be using your ~/Sites/project directory. (See :h :NERDTree) :NERDTree [<start-directory> | <bookmark>] *:NERDTree*...
user avatar
3 votes

Prevent NERDTree from switching tabs when opening a file node?

Yes there is a way! It's called silent open. In NERDTree focus your cursor on the file you want to open in new tab then press T. this will open it silently in a new tab without switching to it. In ...
user avatar
  • 131
3 votes

How to set up NERDTree to CD to current folder when opening it for the first time via :NERDTreeFind

Here is what I did in the end. Thanks to GitHub function! NERDTreeToggleInCurDir() " If NERDTree is open in the current buffer if (exists("t:NERDTreeBufName") && bufwinnr(t:...
user avatar
  • 2,252
3 votes
Accepted

How can I close all NERTree buffers

You can do this with the tabdo command: :tabdo NERDTreeClose This will execute the NERDTreeClose on every tab.
user avatar
  • 15.2k
3 votes
Accepted

Why `NERDTree` doesn't trigger the autocommand `BufEnter`?

tl;dr You cannot filter the buffer at its creation, you should wait until you have more informations. First attempt I used the :debug NERDTree command to see all the calls that this function makes....
user avatar
  • 15.2k

Only top scored, non community-wiki answers of a minimum length are eligible