Shatur / neovim-session-manager

A simple wrapper around :mksession.
GNU General Public License v3.0
497 stars 52 forks source link

Feature Request: Enable / Disable based on configurable directory paths? #14

Open erwin opened 2 years ago

erwin commented 2 years ago

Describe the problem or limitation you are having I tend to have a few different modes for my neovim usage... Development mode --- cd to project directory, edit files, neovim-session-manager currently works great in this context

However, when I'm editing config files, sometimes the session manager gets in the way.

For example...

cd ~
nvim .config/nvim/init.nvim
# now my session for ~ is nvim/init.vim
# :wq
nvim .config/kitty/kitty.conf
# now my session for ~ is kitty/kitty.conf

In this example, there's no connection between nvim's init.vim or kitty's kitty.conf, yet I still will have a session pointing somewhere that's not necessary relevant.

Describe the solution you'd like

I would like an option to set a list of paths that must match the current path before neovim-session-manager activates.

For example, I would like the session manager to be active for any subfolder of ~/Dev

I would like the session manager to be disabled completely for /etc and ~/.config

Describe alternatives you've considered

It's workable now... This just would be a usability enhancement from my perspective. In fact, I think for most users disabling the session for ~, ~/.config, /etc would be a helpful default behavior.

Shatur commented 2 years ago

I found the current behavior useful because the plugin is more like "recent directories" than "recent projects". But I would not mind if someone sends PR for what you described.

dsully commented 2 years ago

+1 - I could really use this functionality, for disabling ~, etc.

JulesNP commented 1 year ago

Same, my only issue currently with this plugin is not being able to disable it for ~

JulesNP commented 1 year ago

I have pull request #59 pending to implement a solution for this requested feature. @Shatur, could you have a look at integrating it?

Shatur commented 1 year ago

@JulesNP I did and left a review. Please, resolve it and I will merge it.

JulesNP commented 1 year ago

Hi @Shatur, I'm not seeing any review on #59, could you be thinking of the other pull request you have?

Shatur commented 1 year ago

Oh, sorry, I forgot to press "Send" :smile: I did it 20 days ago. Thanks for noticing me.