57
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.
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 ...
26
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
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 ...
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)
...
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:
...
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 ~/....
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>" : "...
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.
5
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'...
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:...
5
votes
Accepted
Nerdtree going to specific directory
Use Vim's built-in :cd command to change directory, followed by the NERDTree CD command (note: that's a normal-mode mapping, not an Ex : command.)
So start with:
:cd ~/my/directory/here
(Note that ...
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 = '' ...
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()
...
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 ...
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.
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 && &...
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 ...
4
votes
How to show all LaTeX code but still have set conceallevel=3 for vim-devicons and NERDTree?
I found the answer to my own question after hours of hunting.
This post sheds light on the issue:
https://stackoverflow.com/questions/18160953/disable-latex-symbol-conversion-in-vim
It's resolved ...
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 ...
4
votes
Easily add/open a file in the same folder as the current file/buffer
:Ex<CR> followed by % will prompt you for a new filename in that directory, which can be a pretty smooth process.
Note that there's also set autochdir if that fits your patterns/plugins better (...
4
votes
when viewing the nerdtree window, how can i widen it?
In the Vim vocabulary what you call a "pane" is actually a "window" and the window you want to resize has nothing particular so :h window-resize should give you all you need, ...
3
votes
How to execute xdg-open from NERDTree in Linux?
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 ...
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:...
3
votes
Accepted
How to hide NERDTree when vim called with -R option?
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 &...
3
votes
A side pane file explorer that can list files by modification dates?
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 ...
3
votes
Stop CtrlP from opening in NERDTree
From @jonasl answer, you could also do:
let g:ctrlp_cmd = ':NERDTreeClose\|CtrlP'
3
votes
Accepted
How to change NERDTree plugin window continuously
In Vim you can press Ctrl+w, < or > to decrease and increase window width, respectively. Add comfortable mappings for you, I use the arrow keys, as follows:
nnoremap <Up> :resize +2<CR&...
3
votes
Accepted
Weird behavior of NERDTreeFind function
Judging by the documentation, NERDTreeFind is a command, not a function. This means you do not need :call.
nnoremap <silent> <leader>y :NERDTreeFind<cr>
3
votes
Accepted
Unable to Open NERDTree
The problem is that when you invoke your Tabularize mapping, the : in the right-hand-side of the mapping is remapped to a ; by your colon map, and the keystrokes that are then invoked are:
;...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
plugin-nerdtree × 115vimrc × 24
neovim × 17
buffers × 12
vim-windows × 11
key-bindings × 10
vimscript × 4
netrw × 4
split × 4
tabbed-user-interface × 4
plugin-ctrlp × 4
plugin-system × 3
filesystem × 3
plugin-fugitive × 3
plugin-devicons × 3
terminal × 2
autocmd × 2
functions × 2
macvim × 2
linux × 2
macos × 2
vim8 × 2
plugin-tagbar × 2
cursor-movement × 1
normal-mode × 1