Skip to content

Use with rmagatti/auto-session? #126

Answered by cseickel
bennypowers asked this question in Q&A
Discussion options

You must be logged in to vote

I have two answers for this. The first is that I use use Startify for sessions, and I have always had a "before save" function that closes anything where the filetype has "tree" in the name because this is a universal problem:

function! CustomStartifyBeforeSave() abort
    for win in nvim_list_wins()
        " close floating windows
        if nvim_win_get_config(win).relative > ""
            call nvim_win_close(win, 1)
        else
            " close drawer and tool windows
            let l:ft = nvim_buf_get_option(nvim_win_get_buf(win), "ft")
            if l:ft =~ "tree" || l:ft == "fern" || l:ft == "Trouble"
                call nvim_win_close(win, 1)
            endif
        endi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bennypowers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants