vim and NERD Tree extension - adding a file

Daniel picture Daniel · Sep 22, 2009 · Viewed 80.2k times · Source

When using the vim editor with the NERDTree plugin to navigate through the tree of your project, is there an easy way to create a new source code file under the currently highlighted directory?

Currently I go into my shell, add the file and then refresh the tree. There must be a better way.

Answer

innaM picture innaM · Sep 22, 2009

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 choose a for "add child node". Then simply enter the file's (or directory's name) and you're done.