bufexplorer icon indicating copy to clipboard operation
bufexplorer copied to clipboard

Support toggle for vertical/horizontal splits

Open benthorner opened this issue 3 years ago • 1 comments

Would be great to have this kind of functionality as part of the plugin e.g. ToggleBufExplorerVerticalSplit. I made a quick function to do it, but it's hacky because I couldn't reuse the local variables and functions in the plugin itself.

function! CustomToggleBufExplorer()
    if bufname(winbufnr(0)) == '[BufExplorer]'
        execute 'bd'
    else
        call BufExplorerVerticalSplit()
    endif
endfunction

I'm a fan of vertical splits over replacing the current buffer e.g. with NERDTree. Using a toggle command like this makes it so much smoother to open and close a vertical (or horizontal) split over separate key mapping for each operation.

(Super plugin by the way 💯. I've been using it constantly for many years 🎉.)

benthorner avatar Jul 30 '22 09:07 benthorner

Same need : D I just add another ToggleBufExplorerVertical() to do that~

clinkzlol avatar Aug 25 '23 20:08 clinkzlol