S
S
shrug2282021-09-18 00:21:47
vim
shrug228, 2021-09-18 00:21:47

How to open folders in NERDTree?

To build a project, I need to open the folder with it and run a special command (vim plugin for building). As a file manager for VIM I use NERDTree. It seems good, but there is a problem: when I opened the Projects folder in it, in the terminal I remain in the folder where vim is running and, accordingly, the build command is launched from there, which is not good. I would like that when opening a file in NERDTree, the terminal automatically enters the folder with this file. I'm too lazy to run vim immediately in the project folder, and it's just not the most convenient solution)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mikeyuri, 2021-09-18
@shrug228

Maybe it will help you set autochdir
Read more here

S
shrug228, 2021-09-18
@shrug228

In theory, you can automate the launch by adding a hot key, but then you need to get the path to the current open file through vimscript.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question