Skip to content
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

Custom Session Directory is not set. #1

Open
ChrisGitIt opened this issue Feb 25, 2022 · 6 comments
Open

Custom Session Directory is not set. #1

ChrisGitIt opened this issue Feb 25, 2022 · 6 comments

Comments

@ChrisGitIt
Copy link

Hi and thanks for the plugin!

I tried to set a custom session directory, but it does not seem to work and I get the error that the directory is not existing (referencing to the default "session" dir instead of my set "sessionS" dir (which exists and is used by other plugins)).

I mainly just copied and paste the config:
require('telescope').load_extension('sessions_picker') require'telescope'.setup { extensions = { sessions_picker = { sessions_dir = vim.fn.stdpath('data') ..'/sessions/', } }, }

I tried some debugging, but I'm not good in Lua and just get gibberish when I tried to "print_r(ext_config)" in your setup function

@JoseConseco
Copy link
Owner

Hi chris. Are you sure your sessions dir exist? What if you setup addon path as string, rather than using fn.stdpath ?
like this: '/home/user/.local/share/nvim/session'

@ChrisGitIt
Copy link
Author

Hi @JoseConseco and thanks for your feedback!

Unfortunately it does not seem to work. Your Plugin seems to register just fine with telescope (":Telescope sessions_picker" is there and gives me the error of missing directory)

I also tried an appending / for the directory (little mismatch between doc and code (local sessions_dir = vim.fn.stdpath('data') ..'/session/'))

This is my init.lua:

use {
	'JoseConseco/telescope_sessions_picker.nvim',
	config = function()
		require('setup/session_picker')
	end
}

and in ./lua/setup/session_picker/init.lua:

require('telescope').load_extension('sessions_picker')
require'telescope'.setup {
  extensions = {
    sessions_picker = {
      sessions_dir = '/Users/me-user/.local/share/nvim/sessions',  -- same as '/home/user/.local/share/nvim/session'
    }
  },
}

The directory is definitely up and running (used by Shatur/neovim-session-manager" as Session Manager).

Any other hints? I'm on Mac with nvim 6.1 via https://github.com/qvacua/vimr

Bye the way, I noticed that I had to do ":PackerCompile" in order to install and uninstall your plugin correctly ... not sure what that is about.

@Chetan496
Copy link

Chetan496 commented Jun 2, 2022

@JoseConseco I am facing this issue as well. I really want to use this plugin as it fits my workflow. but this issue is a bit of a blocker. I am on Ubuntu 20.04 and neovim 7.0

@Chetan496
Copy link

@JoseConseco I am facing this issue as well. I really want to use this plugin as it fits my workflow. but this issue is a bit of a blocker. I am on Ubuntu 20.04 and neovim 7.0

I see the problem(s) now..

  1. The plugin has issue if we use bash variables. So variable substitution does not happen
  2. A trailing slash needs to be added.

Here is what worked for me:

local dirForSessions='/home/chetan/nvim-sessions/'
require('sessions').setup({
   events = { "BufEnter" },
   session_filepath = dirForSessions
})

require('telescope').setup {
  extensions = {
   sessions_picker = {
     sessions_dir = dirForSessions  
   }
  }
}

But the following does not work:

local dirForSessions='/home/chetan/nvim-sessions'
require('sessions').setup({
   events = { "BufEnter" },
   session_filepath = dirForSessions
})

require('telescope').setup {
  extensions = {
   sessions_picker = {
     sessions_dir = dirForSessions  
   }
  }
}

and neither does the following work:

local dirForSessions='$HOME/nvim-sessions/'
require('sessions').setup({
   events = { "BufEnter" },
   session_filepath = dirForSessions
})

require('telescope').setup {
  extensions = {
   sessions_picker = {
     sessions_dir = dirForSessions  
   }
  }
}

I think bash variable subsitution should work, that will make the configuration portable.

@JoseConseco
Copy link
Owner

Ok, do you have idea how to implement 'bash substitution'?
For reference for other people this is how config should look like:
image

@mawkler
Copy link

mawkler commented Jul 6, 2022

@JoseConseco I'm guessing that this is where the config should be loaded. With a setup like the one in your screenshot the sessions_dir argument is nil. Have you tried changing sessions_dir to something else in your config, because I think it's always set to the value in your screenshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants