Skip to content

Blank nvim-tree when opening a session from Startify/Dashboard - session related #488

Closed
@imreverse

Description

@imreverse

Whenever I try to load a session from Startify (from the sessionlist) or Dashboard (using sessionsave and sessionload), nvim-tree always shows a blank window.
I save and retrieve my sessions using the following commands,

nnoremap <Leader>ss :source     $HOME/.config/nvim/session/
nnoremap <Leader>sv :mksession! $HOME/.config/nvim/session/

If I try to load a session using the above source command, nvim-tree toggle behaves as expected and shows the directory of the session.

Here is the config which is able to reproduce the above error.

call plug#begin('~/.config/nvim/plug')
Plug 'kyazdani42/nvim-tree.lua'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'mhinz/vim-startify'
call plug#end()
nnoremap <A-e> :NvimTreeToggle<CR>
nnoremap <Leader>ss :source $HOME/.config/nvim/session/
nnoremap <Leader>sv :mksession! $HOME/.config/nvim/session/
let g:startify_files_number = 7
let g:startify_session_dir="$HOME/.config/nvim/session"
let g:startify_lists = [
      \ { 'type': 'bookmarks', 'header': ['   Bookmarks']      },
      \ { 'type': 'sessions',  'header': ['   Sessions']       },
      \ { 'type': 'files',     'header': ['   MRU']            },
      \ { 'type': 'commands',  'header': ['   Commands']       },
      \ ]

I have tried this using Packer and Plug both, yet the problem persists.
I also have tried nerdtree, and it works as expected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions