neovim-project icon indicating copy to clipboard operation
neovim-project copied to clipboard

No lazy loading support

Open TroySigX opened this issue 1 year ago • 17 comments

Problem:

I'm in my project directory and opens nvim for the first time (no previous session was saved). After exiting neovim, I'd expect `neovim-project' to not open any buffer (since no file was opened last time) the next time I type 'nvim', but instead, it opens an empty buffer

Reproduction

  1. Delete previous session save via :Telescope neovim-project history 2.Enter nvim from the terminal, from here, I have my startup dashboard show up like this: image

  2. Exit neovim

  3. Enter nvim again, from this, I'd expect to see my dashboard again, but instead, an empty buffer was opened, as in the picture: image

TroySigX avatar Sep 29 '23 23:09 TroySigX

Hmm, this issue only persists only when I set event = 'VeryLazy' in lazy.nvim. Could it somehow be fixed?

TroySigX avatar Sep 30 '23 00:09 TroySigX

Hi, installation instruction contains priority=100, this option is mutually exclusive with lazy loading. Please don't use event and add lazy = false if you have enabled lazy by default.

coffebar avatar Sep 30 '23 07:09 coffebar

If you open nvim in the project directory (that matches the pattern) its expected behavior is to see an empty buffer or saved session. The only way to see your StartupPage is to open nvim outside the projects dir with option last_session_on_startup = false

The reason why it is done in this way: I believe that switching to the project directory in the terminal expresses the intention to work with this particular project. This is one of the possible ways to choose a project

coffebar avatar Sep 30 '23 09:09 coffebar

If you want to bypass session loading and open Dashboard only, you can create some alias, for example:

alias vd="nvim -c Dashboard -- _" add this to your .zshrc or .bashrc

and use vd instead of nvim to open the Dashboard

coffebar avatar Sep 30 '23 13:09 coffebar

Hi, installation instruction contains priority=100, this option is mutually exclusive with lazy loading. Please don't use event and add lazy = false if you have enabled lazy by default.

Yes, but is there any way for the plugin to be lazy loaded?

TroySigX avatar Sep 30 '23 20:09 TroySigX

Hmm, it seems that neovim-project won't work correctly when lazy-loaded

TroySigX avatar Sep 30 '23 21:09 TroySigX

Hmm, it seems that neovim-project won't work correctly when lazy-loaded

yes, that's right

coffebar avatar Oct 01 '23 05:10 coffebar

Just discovered this wonderful plugin and I am loving it.

I was also wondering if it would be possible to have a dashboard (if it exists in one's config) being displayed. Is this feature queued for development, given that the issue has been open for a while now?

PhyTensor avatar Dec 24 '23 14:12 PhyTensor

I was also wondering if it would be possible to have a dashboard (if it exists in one's config) being displayed.

this feature is not related to the opened issue. Yes, you can disable session auto loading in config and use your dashboard

coffebar avatar Dec 24 '23 16:12 coffebar

last_session_on_startup = false

coffebar avatar Dec 24 '23 16:12 coffebar

last_session_on_startup = false

Actually I can't use NVimTree if I don't set this to false. Worth to put this into README?

Update: even if I set it to false, I have to open NVimTree once, before opening any project from the history. Otherwise NVimTree will be broken.

szevzol avatar Feb 19 '24 12:02 szevzol

last_session_on_startup = false

Actually I can't use NVimTree if I don't set this to false. Worth to put this into README?

Update: even if I set it to false, I have to open NVimTree once, before opening any project from the history. Otherwise NVimTree will be broken.

Worth to open an issue, not sure here or maybe in the NVimTree repo. NeoTree works fine for me, didn't test with NVimTree.

coffebar avatar Feb 19 '24 16:02 coffebar

last_session_on_startup = false

Actually I can't use NVimTree if I don't set this to false. Worth to put this into README? Update: even if I set it to false, I have to open NVimTree once, before opening any project from the history. Otherwise NVimTree will be broken.

Worth to open an issue, not sure here or maybe in the NVimTree repo. NeoTree works fine for me, didn't test with NVimTree.

Thanks, I will use neotree, which is also a nice plugin :)

szevzol avatar Feb 22 '24 14:02 szevzol

I don't want to hijack this thread, but I thought it's worth to share my finding about using NvimTree together with neovim-project:

You have to call nvim-tree's setup function explicitly in your neovim-project configuration:

    init = function()
      -- enable saving the state of plugins in the session
      vim.opt.sessionoptions:append("globals") -- save global variables that start with an uppercase letter and contain at least one lowercase letter.
      require("nvim-tree").setup {}
    end,

szevzol avatar Feb 23 '24 22:02 szevzol

Also had this issue, unclear why. Is the high priority loading of nvim-project preventing other plugins from loading for some reason?

jonestristand avatar Feb 23 '24 22:02 jonestristand

Also had this issue, unclear why. Is the high priority loading of nvim-project preventing other plugins from loading for some reason?

I removed the priority setting and unfortunately it didn't help.

szevzol avatar Feb 24 '24 21:02 szevzol

This also seems to break changing the nvim-tree root directory with cd.... @coffebar

jonestristand avatar Feb 26 '24 06:02 jonestristand