NERDTree reload new files

前端 未结 5 1348
醉酒成梦
醉酒成梦 2021-01-29 18:44

If I add a file to the same directory opened in NERDTree, the only way I can see the file added is if I quit vim and start it again .

Is there a way I can

5条回答
  •  梦如初夏
    2021-01-29 19:32

    Refresh NERDTree

    Instead of hitting R in the NERDTree window, I use a custom map that does it for me:

    nmap r :NERDTreeRefreshRoot
    

    I've mapped it to Leader + r, but you can map it to whatever you want.


    Explanation:

    • It first switches to the NERDTree window
    • Then refreshes the Root Node (by simulating the R key)
    • And finally switches back to the previous window

    Note: You can add a last step to refresh CtrlP along with NERDTree

提交回复
热议问题