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()