-
Notifications
You must be signed in to change notification settings - Fork 462
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
Adapt to lazy load session_lens of auto-session #742
Comments
We have lazy loaded the nvimdots/lua/modules/plugins/editor.lua Line 10 in 42e816b
It does't affect the startuptime. |
Oh I mean, if someone (like me) enable the |
Use a command to wrap these two lua functions maybe the simplest way. return function()
require("auto-session").setup({
log_level = "info",
auto_session_enable_last_session = true,
auto_session_root_dir = vim.fn.stdpath("data") .. "/sessions/",
auto_session_enabled = true,
auto_save_enabled = true,
auto_restore_enabled = true,
auto_session_suppress_dirs = nil,
session_lens = {
-- If load_on_setup is set to false, one needs to eventually call `require("auto-session").setup_session_lens()` if they want to use session-lens.
load_on_setup = false,
theme_conf = { border = true },
previewer = false,
},
})
vim.api.nvim_create_user_command("SessionLenShow", function()
require("auto-session").setup_session_lens()
require("auto-session.session-lens").search_session()
end, { nargs = 0 })
end I will create a pr for it if acceptable. |
LGTM! |
Feature description
Currently, auto-session start with configuring session_lens, so that if we start with auto-session, it will load telescope immediately and will cost about 40 ms at startup.
Now, it fixed this issue by rmagatti/auto-session#231, and we can configure this for auto-session:
to avoid loading telescope at start, which will only cost about 1ms even if we load auto-session at startup.
This issue is suggesting adding the configuration above to the auto-session config. And if possible, I can create a pr for it.
Besides, I wonder whether we should call
require("auto-session").setup_session_lens()
at some point before using session-lensAdditional information
No response
The text was updated successfully, but these errors were encountered: