diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-01-18 13:38:08 +0100 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-10-30 09:52:23 +0100 |
commit | 2243a7fd58faafb5cb4d2ab3947b3adab8eeb475 (patch) | |
tree | f182e3df8ea5254ea8a6ccdbf3a225b3bff63f22 /.config/nvim/plugins/aerial.vim | |
parent | 41cc0c57cde2517f774c05147e2d5bcc9813f724 (diff) |
[nvim] reorganize config and plugins
Diffstat (limited to '.config/nvim/plugins/aerial.vim')
-rw-r--r-- | .config/nvim/plugins/aerial.vim | 28 |
1 files changed, 28 insertions, 0 deletions
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 <<EOF +require('aerial').setup({ + filter_kind = false, +}) + +require('telescope').load_extension('aerial') +EOF + +nnoremap <leader>a <cmd>AerialToggle!<CR> +nnoremap <leader>fa <cmd>Telescope aerial<CR> + +" 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() |