Automatically quit vim if NERDTree is last and only buffer

后端 未结 5 743
鱼传尺愫
鱼传尺愫 2020-12-07 22:36

I have the following in my .vimrc:

\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"         


        
5条回答
  •  一向
    一向 (楼主)
    2020-12-07 22:48

    An idea in need of implementation:

    You could write a function which, when called, checks if the only buffer remaining (or perhaps the only non-help buffer, if you prefer) is a NERDTree buffer and, if so, deletes it (or just quits).

    Then have an autocmd run it whenever a buffer is deleted / hidden / whatever actually happens when you :q (it shames me to admit I'm not entirely sure!).

提交回复
热议问题