nvim-tree.lua icon indicating copy to clipboard operation
nvim-tree.lua copied to clipboard

`:NvimTreeToggle` - toggle file explorer in all tabs

Open erikw opened this issue 3 years ago • 0 comments

I would like the file browser to act globally meaning that it's either hidden in all tabs or visible in all tabs.

By setting

open_on_tab = true

I can get halfway there. The problem is that there's no way that I've found to close the open all file explorers.

Is there already a way to do accomplish this (closing all open file explorers)? Otherwise this could be a separate command :NvimTreeToggleGlobally that overrides individual tab statuses and force closes or opens the file explorer in all tabs.

Update

I found that I can make a global close and open by using two different keyboard shortcuts.

noremap <silent> <F2> :NvimTreeOpen<CR>
function! NvimTreeCloseAll()
	let current_tab = tabpagenr()
	tabdo NvimTreeClose
	execute 'tabnext' current_tab
endfunction
" }
nnoremap <silent> <S-F2> :call NvimTreeCloseAll()<CR>

But the best would be a global toggle like described above!

erikw avatar Aug 09 '22 15:08 erikw