Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NERDTree (Vim): How to open a file with path in NERDTree quickly

Tags:

vim

nerdtree

I'm newbie in vim (NERDTree). My question: How to open a file with a path by command (like: vim /etc/hosts) And open this file in new tab

Thanks for help.

like image 588
Tue Vo Avatar asked Oct 15 '25 10:10

Tue Vo


2 Answers

You can just type in:

:tabnew /path/to/file

If you want to use NERDTree, you can open NERDTree (type :NERDTree), navigate to your file, and then press t with cursor on the file name. This will open specific file in new tab.

Also, while in NERDTree, you can hit ?. That will show you it's internal help with list of available commands. Hit ? again to exit help and enjoy :)

See also :help NERDTree, if you want more complete documentation.

like image 114
qiubix Avatar answered Oct 18 '25 14:10

qiubix


:tabnew some/path/to/some/file

like image 42
Tony Hopkinson Avatar answered Oct 18 '25 15:10

Tony Hopkinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!