From c6465b737199110315a33dcb97de22a64c7d7c8c Mon Sep 17 00:00:00 2001 From: np2048 Date: Sat, 16 Mar 2019 21:40:30 +0300 Subject: [PATCH] https://vi.stackexchange.com/questions/3489/nerdtree-how-to-open-a-file-and-automatically-close-the-explorer-buffer --- F.A.Q..md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/F.A.Q..md b/F.A.Q..md index e69c1ad..d60900f 100644 --- a/F.A.Q..md +++ b/F.A.Q..md @@ -76,4 +76,11 @@ Use these variables in your vimrc. Note that below are default arrow symbols. ## How can I open files, directories, and bookmarks in new tabs? -Use the `t` and `T` mappings in the NERDTree window. \ No newline at end of file +Use the `t` and `T` mappings in the NERDTree window. + +## How can I close NERDTree window after opening a file in it + +You can define a hot key for it in your .vimrc file. In the example below the d+ key is defined to do so. This hotkey will be valid only until the NERDTree is closed. + + autocmd BufEnter NERD_tree_* nmap d :NERDTreeToggle + autocmd BufLeave NERD_tree_* unmap d \ No newline at end of file