From 6c576a1294f2f8d52872f9af86ae203d80ef3439 Mon Sep 17 00:00:00 2001 From: labrick Date: Fri, 27 Nov 2015 13:10:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=B7=B1=E7=9A=84?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E9=94=AE=E6=98=A0=E5=B0=84=E5=85=B3=E7=B3=BB?= =?UTF-8?q?=EF=BC=8C=E8=AE=BE=E7=BD=AENERDTree=E7=9A=84=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=89=93=E5=BC=80=E4=B8=8E=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- my_configs.vim | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/my_configs.vim b/my_configs.vim index 300eb96e..517e65b1 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -1,5 +1,16 @@ set nu -let Tlist_Auto_Open=1 +syntax on set tags=tags; -set autochdir; +set autochdir + +"How can I open a NERDTree automatically when vim starts up if no files were specified? +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif + +"How can I close vim if the only window left open is a NERDTree? +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif + +nmap be :BufExplorer +nmap nt :NERDTree +nmap tl :Tlist