37

In your vimrc add nmap <F6> :NERDTreeToggle<CR> where <F6> is the key you want to map.


33

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 Vundle, required Plugin 'gmarik/Vundle.vim' " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin ...


24

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 this line into your vimrc. Taglist For taglist, you set a similar option: :let g:Tlist_WinWidth=60 Like with NERDTree, you can put this line into your vimrc. ...


17

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


13

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 you ask.


9

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 little bit of per-filetype configuration, the :dlist command could be used to list every function in the current file and included files: :dlist / See :help ...


8

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: function! CtrlPCommand() let c = 0 let wincount = winnr('$') " Don't open it here if current buffer is not writable (e.g. NERDTree) while !empty(...


8

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) autocmd! VimEnter * NERDTree | wincmd w


7

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 ~/.vimrc, whose contents are executed before any plugins are normally loaded, requires that the source for that command be sourced first. Alternatively, you could ...


6

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><enter>/sou/<enter><enter>j<enter>. One thing I really like about this method is that I can search for any substring. Some of my ...


6

Spelling is the issue. Plugin 'scroolosse/nerdTree' Should be Plugin 'scrooloose/nerdTree' The double s is the clincher. GitHub Scrooloose NerdTree repo


5

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


5

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 better option answer comes up I'll gladly unmark mine as accepted and accept the new one) The idea is to use the folowing mapping: map d<cr> <cr>:...


5

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.


4

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 this to make the split wider by using :vertical resize. For example, map <c-o> :vertical resize +10 which will increase the vertical size of the split ...


4

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 endif And the _reuseWindow() function (ref. line 309): function! s:Opener._reuseWindow() "check the current tab for the window let winnr = bufwinnr('...


4

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 = '' nnoremap <c-p> :NERDTreeClose\|CtrlP<CR> Explanation: The first line makes CtrlP not overwrite your custom mapping. And the second ...


4

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 call it) then change the sorting order with s. You may also want to see the change dates. You can see this by pressing i.


4

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 && &filetype != 'nerdtree' | close | endif endfunction command! Only call OnlyAndNerdtree() The function gets the id of the current window with win_getid() then it ...


4

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 NERDTree window. If you're just asking for a non-mouse way to do that then one answer is 2^wh. That is, hit 2 then Ctrl+W then H. (Refer to :h CTRL-W_CTRL-H) However, ...


4

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't work for you, create an issue in the NERDTree repo.


4

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:disable_lightline_on_nerdtree() augroup END fu s:disable_lightline_on_nerdtree() abort let nerdtree_winnr = index(map(range(1, winnr('$')), {_,v -> getbufvar(winbufnr(v), ...


3

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() endif


3

Instead of just asking if there are no arguments, you could also ask if the buffer is empty. If you substitute !argc() in your autocmd by !argc() && bufnr('$') == 1 && line('$') == 1 && getline(1) == '' you should get the desired result.


3

You could use netrw's :Lexplore command (usually shortened to :Lex) to get a side pane. As Tumbler41 said, you can change the sorting order with s; you can also have netrw start up with that sorting method by putting let g:netrw_sort_by= "time" in your .vimrc.


3

From @jonasl answer, you could also do: let g:ctrlp_cmd = ':NERDTreeClose\|CtrlP'


3

You can do this with the tabdo command: :tabdo NERDTreeClose This will execute the NERDTreeClose on every tab.


3

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. When trying to stop it before the end I noticed something : A buffer was created, without name, without filetype. And it had the position/size of the nerdtree ...


3

From the documention it would seem that it should be using your ~/Sites/project directory. (See :h :NERDTree) :NERDTree [<start-directory> | <bookmark>] *:NERDTree* Opens a fresh NERD tree. The root of the tree depends on the argument given. There are 3 cases: If no argument is given, the current directory ...


3

I figure out the reason why this plugin doesn't work: git clone https://github.com/aufgang001/vim-nerdtree_plugin_open.git ~/.vim/vim-nerdtree_plugin_open.git The instruction is wrong, it should put inside ~/.vim/bundle (at least in my case): git clone https://github.com/aufgang001/vim-nerdtree_plugin_open.git ~/.vim/bundle/vim-nerdtree_plugin_open.git


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