diff --git a/vim/.vimrc b/vim/.vimrc index ac7e695..28eba0d 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -11,7 +11,8 @@ set expandtab so ~/.vim/plugins.vim -map :NERDTreeToggle +let mapleader = "," " map leader to comma + set laststatus=2 set noshowmode set showmatch @@ -51,13 +52,29 @@ inoremap { {} inoremap { {}O inoremap {; {};O +nnoremap n :NERDTreeFocus +nnoremap :NERDTree +nnoremap :NERDTreeToggle +nnoremap :NERDTreeFind + set number syntax on let g:NERDTreeDirArrowExpandable = '▸' let g:NERDTreeDirArrowCollapsible = '▾' +" Start NERDTree when Vim is started without file arguments. autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif +" Exit Vim if NERDTree is the only window remaining in the only tab. autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif + +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%* + +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 0 \ No newline at end of file diff --git a/vim/plugins.vim b/vim/plugins.vim index 58b1fb4..640a0ce 100644 --- a/vim/plugins.vim +++ b/vim/plugins.vim @@ -5,6 +5,8 @@ call vundle#begin() Plugin 'scrooloose/nerdtree' Plugin 'itchyny/lightline.vim' Plugin 'airblade/vim-gitgutter' +Plugin 'tpope/vim-fugitive' +Plugin 'scrooloose/syntastic' call vundle#end()