diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-11-06 15:54:24 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-11-06 15:54:24 +0100 |
commit | 99ae247eacf35697c607d880675d910fcce90ae3 (patch) | |
tree | c54bd8b42a56c7ad94ff138c69fd85005b02f4ae /.config/nvim/plugins/nerdtree.vim | |
parent | d9f12831186077736fcd9c163a4b31a1fa28690e (diff) |
[nvim] refactor plugins to use lazy.nvim
Diffstat (limited to '.config/nvim/plugins/nerdtree.vim')
-rw-r--r-- | .config/nvim/plugins/nerdtree.vim | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/.config/nvim/plugins/nerdtree.vim b/.config/nvim/plugins/nerdtree.vim deleted file mode 100644 index 7caf768..0000000 --- a/.config/nvim/plugins/nerdtree.vim +++ /dev/null @@ -1,58 +0,0 @@ -let g:NERDTreeShowHidden=1 -let g:NERDTreeGitStatusShowIgnored=1 - -:let g:NERDTreeShowLineNumbers=1 -:autocmd BufEnter NERD_* setlocal rnu - -if !&diff - autocmd StdinReadPre * let s:std_in=1 -endif - -function NERDTreeInit() - if !&diff - let buffer_type = getbufvar(bufnr(), "&filetype") - if index(g:NERDTreeNoInitFiletypes, buffer_type) == -1 - NERDTree - - if argc() > 0 || exists('s:std_in') - wincmd p - endif - - if argc() > 0 - silent NERDTreeFind - wincmd p - endif - endif - endif -endfunction -autocmd VimEnter * call NERDTreeInit() - -autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif -autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif - -" set status line on tab switch -function NERDTreeStatusLineTabSwitch() - " only when in non-meaningful window - if index(g:NERDTreeStatusLineTabSwitchFiletypes, &filetype) == -1 - return - endif - - let tab_nr = tabpagenr() - let buffer_list = tabpagebuflist(tab_nr) - - " default to 2 - let meaningful_window_nr = 2 - - for buffer_nr in buffer_list - let buffer_type = getbufvar(buffer_nr, "&filetype") - if index(g:NERDTreeStatusLineTabSwitchFiletypes, buffer_type) == -1 - let meaningful_window_nr = bufwinnr(buffer_nr) - break - endif - endfor - - exe meaningful_window_nr .. "wincmd w" -endfunction -autocmd TabLeave * call NERDTreeStatusLineTabSwitch() - -map <C-b> <cmd>NERDTreeToggle<CR> |