Skip to content

A session-switcher extension for rmagatti/auto-session using Telescope.nvim

License

Notifications You must be signed in to change notification settings

willthbill/session-lens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Session Lens

Session Lens extends auto-session through Telescope.nvim, creating a simple session switcher with fuzzy finding capabilities.

Usage

You can call the switcher from telescope

:Telescope session-lens search_session

Or straight from the plugin's path with lua

:lua require('telescope._extensions.session-lens.main').search_session()

Installation

Any plugin manager should do, I use Plug.

Plug 'rmagatti/session-lens'

The plugin is lazy loaded when calling it for the first time but you can pre-load it with Telescope like this if you'd rather have autocomplete for it off the bat.

require("telescope").load_extension("session-lens")

Configuration

Custom

Options can be set by calling the setup function, a common option is changing the shorten path behaviour.

require('telescope._extensions.session-lens').setup {
    shorten_path=<true|false>,
}

Another example would be changing how the dropdown looks, this can be done by setting the theme_conf in the setup opts. The options in theme_conf get passed into require('telescope.themes').get_dropdown(theme_conf), so anything supported by get_dropdown can be used here as well.

require('telescope._extensions.session-lens').setup {
  shorten_path = true,
  theme_conf = { previewer = true, border = false }
}

In addition to the above configs, since everything gets passed into telescope.builtin.find_files, any configs passed to the setup if supported by find_files will override the default behaviour, for example:

require('telescope._extensions.session-lens').setup {
    prompt_title = 'YEAH SESSIONS',
}

^ This config results in this: Screen Shot 2021-04-17 at 8 16 49 PM

Commands

Session Lens exposes one command

  • :SearchSession triggers the customized session picker

Compatibility

Neovim > 0.5

Tested with:

NVIM v0.5.0-dev+a1ec36f
Build type: Release
LuaJIT 2.1.0-beta3

About

A session-switcher extension for rmagatti/auto-session using Telescope.nvim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 93.9%
  • Vim Script 6.1%