Add NERDTree plugin and config

This commit is contained in:
Edward Litherland-Smith 2022-04-27 10:56:28 +01:00
parent 49df22cd10
commit a3283674aa
3 changed files with 13 additions and 0 deletions

3
.gitmodules vendored
View file

@ -59,3 +59,6 @@
path = pack/plugins/start/fzf
url = git@github.com:junegunn/fzf.vim.git
branch = master
[submodule "pack/plugins/start/nerdtree"]
path = pack/plugins/start/nerdtree
url = https://github.com/preservim/nerdtree.git

@ -0,0 +1 @@
Subproject commit eed488b1cd1867bd25f19f90e10440c5cc7d6424

9
vimrc
View file

@ -78,6 +78,15 @@ command Bd b# | bd #
command! BufOnly silent! execute "%bd|e#|bd#"
nnoremap <Leader>b :buffers<CR>:buffer<Space>
nnoremap <Leader>i :!zimports %<CR>:!black %<CR><CR>
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" Open the existing NERDTree on each new tab.
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
set splitbelow
set splitright