Skip to content

:NvimTreeToggle - toggle file explorer in all tabs #1493

Closed
@erikw

Description

@erikw

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedQOLQuality Of Life Improvementfeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions