Activate the NERDTree and navigate to the directory in which the new file should live. Then press m to bring up the NERDTree Filesystem Menu and chose a for "add child node". Then simply enter the file's (or directory's name) and you're done.
How to copy (or duplicate) an entire folder in Vim using NERDTree?
NERDTree Menu. Use j/k/enter and the shortcuts indicated
==========================================================
> (a)dd a childnode
(m)ove the curent node
(d)elete the curent node
(c)copy the current node
m + c
on the folder would duplicate itHow to jump back to NERDTree from file in tab?
ctrl-ww http://stackoverflow.com/questions/1656591/how-to-jump-back-to-nerdtree-from-file-in-tab
Better Solution:I've just started using the NERDTree vim plugin for my project.
I can't find the documentation for switching between opened tabs. Can anyone tell me the shortcut key[s] ?
Thanks...
==Answer==
An additional option (and my personal choice)beyond the ones listed by Michael Madsen:
gt = next tab
gT = previous tab
A quick check in :h tabs reveals it's CTRL-Page Down to cycle between tabs. You can also use the :tabnext command (:tabn for short).
==Answer==
I like to bind my vim navigation keys to switching between tabs. Here are the lines from my .vimrc file:
map:tabn map :tabp map :tabnew
That way, I can switch between tabs using the left and right buttons just like I normally would move the cursor, except I just hold the Control key as well.
- Control+l moves to the next tab
- Control+h moves to the previous tab
- Control+n creates a new tab
NERDTree Menu. Use j/k/enter and the shortcuts indicated
==========================================================
> (a)dd a childnode
(m)ove the curent node
(d)elete the curent node
(c)copy the current node
Moving is the same as renaming.
Activate the NERDTree and navigate to the directory in which the new file should live. Then press m to bring up the NERDTree Filesystem Menu and chose a for "add child node". Then simply enter the file's (or directory's name) and you're done.
OR
from vim you can run shell commands. So in this case I use:
:!touch somefile.txt
and then hit 'r' to reload the nerdtree window.
The other thing to do is to just start the new file from within vim.
:e somefile.txt
One handy thing for this is that in my .vimrc I auto change the cwd to the directory my current file is in:
" Auto change the directory to the current file I'm working on
autocmd BufEnter * lcd %:p:h
This way if I'm editing a file and want another one in the same place the path is changed right there. Opening any file from NERDTree sets the directory to the one that file is in
Changing drive letter in NERDtree
I started using NERDtree plugin on a a windows platform. I can't seem to find a way to change the drive letter. Going up all the way on the directory tree doesn't lead to the drive letter. Any ideas? (Yes, I know, it's going to be a simple answer)
:NERDTree "drive letter":\
REFERENCES
http://www.8t8.us/vim/vim.html
How do I insert text at beginning of a multi-line selection in VI/VIM? For commenting blocks of code, I like the NERD Commenter plugin. Select some text: Comment: Uncomment: Or just toggle the comment state of a line or block:
REFERENCES
|