From 2243a7fd58faafb5cb4d2ab3947b3adab8eeb475 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 18 Jan 2023 13:38:08 +0100 Subject: [nvim] reorganize config and plugins --- .config/nvim/plugins/aerial.vim | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .config/nvim/plugins/aerial.vim (limited to '.config/nvim/plugins/aerial.vim') diff --git a/.config/nvim/plugins/aerial.vim b/.config/nvim/plugins/aerial.vim new file mode 100644 index 0000000..9a6db49 --- /dev/null +++ b/.config/nvim/plugins/aerial.vim @@ -0,0 +1,28 @@ +lua <a AerialToggle! +nnoremap fa Telescope aerial + +" add aerial to tab switch filetypes +call add(g:NERDTreeStatusLineTabSwitchFiletypes, 'aerial') + +" close Aerial and NERDTree if they are the only remaining windows +function AerialNERDTreeClose() + if winnr('$') != 2 + return + endif + + let window_filetypes = UtilityWinfiletypes() + + if index(window_filetypes, 'aerial') != -1 && index(window_filetypes, 'nerdtree') != -1 + " one quit suffices, since aerial and nerdtree close themselves + quit + endif +endfunction +autocmd BufEnter * call AerialNERDTreeClose() -- cgit v1.2.3