-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Neovim Session Manager integration to create IDE-like project switching #101
base: main
Are you sure you want to change the base?
Conversation
UPD: after a month of using this update I am happy with it and have nothing to change about it. |
I don't understand why the command ["coffebar/project.nvim"] = {
branch = "session-manager",
config = function()
require("project_nvim").setup({
session_autoload = true,
silent_chdir = false,
})
end,
},
-- session manager
["Shatur/neovim-session-manager"] ={}, |
@wenanoshe config seems ok. Did you run ls ~/.local/share/nvim/site/pack/packer/start | grep -P 'project|session' should display installed plugins
|
Yeah, it displays that
But the comand still not working, shows me that
|
Projects need to be registered as extension for telescope require("telescope").load_extension("projects") |
Where i set that command?, excuse my ignorance |
where you put telescope config |
Maybe it's time for a fork? There's a lot of low-hanging fruit PRs that is being ignored for over a year now, so I think the dev isn't really interested in maintaining/improving this project anymore. |
Update:I decided to create a fork, focused on my desired workflow with auto-saved sessions.This fork has different vision and way. project.mp4 |
I would prefer we get #77 to avoid coupling to a single session manager plugin. |
merged here |
Goal: create IDE-like project switching with saved sessions
Demo how it works in this PR:
I'm switching projects by using
:Telescope projects
(i mapped this command to<leader>p
for me, but only in my personal configuration).As you can see on the video, opened tabs depends on which project is opened and everything auto-saving when switching projects.
rec.webm
Before merge this PR, you can test it by installing from packer:
Not sure if
require("session_manager").setup({...
is required by neovim-session-manager, it seems not, but i'm using configuration options for that plugin.How it NOT breaking things
With default configuration it will not bring any additional features. To add integration user have to enable a new option "session_autoload".
If this option will be enabled, but session manager plugin is not installed, user will see warning message from this code:
When plugin is installed and option is enabled, project selection can be done in 3 ways:
:Telescope projects
type project keywords and press<CR>
:Telescope projects
type project keywords and press<C-w>
<C-d>
will work for delete project from history as usual.Important
When session manager is installed, using
find_project_files
is not recommended! Opening individual files will make projects.nvim to change current directory, and session manager will automatically overwrite saved sessions with mess from individual files from different projects.Therefore, using these two plugins together as it was before this PR - is a bad idea. This should fix problem.
Testing
I have tested only for 2 days by using this branch in my Neovim setup. Testing from different configs and workflows are welcome.
Known issues
<C-f>
will switch project, so find_project_files is totally disabled with session_autoload=true.<C-b>
leads to error for me: telescope.builtin.file_browser is nil. I believe this is related with telescope update