Git Product home page Git Product logo

telescope-session.nvim's Introduction

  ____  _____            _                             _             
 |___ \|___ /     __   _(_)_ __ ___  ___  ___  ___ ___(_) ___  _ __  
   __) | |_ \ ____\ \ / / | '_ ` _ \/ __|/ _ \/ __/ __| |/ _ \| '_ \ 
  / __/ ___) |_____\ V /| | | | | | \__ \  __/\__ \__ \ | (_) | | | |
 |_____|____/       \_/ |_|_| |_| |_|___/\___||___/___/_|\___/|_| |_|


๐Ÿ”—Telescope a highly extendable fuzzy finder over lists. This plugin is an extension of telescope, it provides something to help you manage your vim sessions

Features


  • Display your session file list
  • Switching between your vim seesions
  • Manage your seesion file
  • Save your vim seesion to the default location (or a custom location)

Requirements


  • Neovim (v0.7.0) or the latest neovim nightly commit is required for telescope.nvim to work.
  • ๐Ÿ”—lua/plenary.nvim is required.

Optional

Getting Started

demo

Using packer.nvim

use({
 "nvim-telescope/telescope.nvim",
 -- tag = "0.1.0",
 branch = "0.1.x",
 requires = { { "nvim-lua/plenary.nvim" } },
 config = function()
  require("telescope").setup({
   extensions = {
    xray23 = {
     -- location to store session files, default is vim.fn.stdpath("data") .. "/vimSession"
     sessionDir = "/path/to/session-file",
    },
   },
  })
  -- loade telescope-session.nvim
  require("telescope").load_extension("xray23")
 end,
})
use("HUAHUAI23/telescope-session.nvim")

Usage


commands

" Display your session file list
:Telescope xray23 list

" input the seesion file name (null will use default session file name)
" and save it to the default location  (or a custom location)
:Telescope xray23 save

telescope keybinds

see ๐Ÿ”—Telescope Default Mappings
telescope-session.nvim provides two additional normal mode keybinds

Mappings Action
enter switch to selected session
d delete selected session

neovim keybind
if you want to set up neovim keymap you can do something like this

-- press <space>s  will open session files list
vim.keymap.set("n", "<space>s", "<cmd>Telescope xray23 list<cr>")

-- or create a user command and use it to save vim session
vim.api.nvim_create_user_command("SessionSv", function()
 vim.api.nvim_cmd(vim.api.nvim_parse_cmd("Telescope xray23 save", {}), {})
end, { desc = "load user session,like workspace" })

Development

git clone https://github.com/HUAHUAI23/telescope-session.nvim.git
cd telescope-session.nvim/lua/session-manage/

See plugin/session-manage for details

telescope-session.nvim's People

Contributors

huahuai23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

telescope-session.nvim's Issues

`entry_maker` option doesn't seem to work.

Hi, I use folke/persistence.nvim for saving my sessions, so their filenames are a bit ugly (e.g. %home%rizhiy%.local%state%nvim%sessions.vim).
I thought that I can modify how they are displayed using entry_maker options, but it doesn't seem to be working.
Here is my attempt:

extensions = {
    xray23 = {
        sessionDir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"),
        entry_maker = function(entry)
            return {
                value = entry,
                display = entry:match("[^%%]*$"):sub(1, -5),
                ordinal = entry[1],
            }
        end,
    },
},

What am I doing wrong?

I tried using vim.print() to debug, but it seems the function is not even being called.

New FT for the saved sessions

This plugin is awesome, congrats! It allow us to give proper names to the sessions we are working on .. super useful specially when working on different projects at once

Only one thing I customized.. each session feels like a bookmark to the files / projects so I gave it a different look..

ie:

image

If you think this is something you want I can create a PR for you .. but this will require users to change/tweak their web_devicons too (or I could create a PR to web_devicon)

Thanks

add feature: "return" to load session in insert mode

Hi, thanks for your awesome plugin, I loved this plugin once I tried it, because it was just small enough and that's what I wanted.

But one thing that might make sense to consider is... You could add a mapping to insert mode so that the session can be loaded just press "enter" after searching. The current behavior is to jump to the session management file, which should be invisible to user and not a thing user really care about.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.