GithubHelp home page GithubHelp logo

nvim-sessions's Introduction

nvim-sessions

A simple session management plugin for Neovim. It uses :mksession to save and :source to load working directory based sessions.

Warning

This plugin is based on my personal needs. Work in progress. ๐Ÿš€

Other better plugins are:

Features

  • Uses one session file per working directory
  • Session files are stored global in vim.fn.stdpath('data') in a configurable subdirectory
  • Sessions are manually saved, loaded and deleted
  • It ignores empty windows from plugins like nvim-tree or outline
    (removes temporary blank from the :h sessionoptions)

Tip

See :h sessionoptions to change what is stored in the session file with :mksession.

Requirements

  • Neovim >= 0.10

Installation

return {
  'tigion/nvim-sessions',
  keys = {
    { '<Leader>ws', '<Cmd>Session save<CR>', desc = 'Save session (cwd)' },
    { '<Leader>wl', '<Cmd>Session load<CR>', desc = 'Load session (cwd)' },
  },
  opts = {},
}

Configuration

The default options are:

{
  -- The name of the subdirectory in `vim.fn.stdpath('data')`
  -- where the sessions are saved.
  -- If it does not exist, it will be created.
  directory = 'sessions', ---@type string

  -- Overwrites existing session files without confirmation.
  overwrite = true, ---@type boolean
}

For other plugin manager, call the setup function require('sessions').setup({ ... }) directly.

Usage

Command Description
:Session Shows information about the current session and the Session command
:Session save Saves the current session for the current working directory
:Session load Loads the session for the current working directory
:Session delete Deletes the session for the current working directory

Run :checkhealth sessions to check the health of the plugin.

TODO

  • Move simple session management from tigion.core.util.session to a plugin.
  • Update readme

nvim-sessions's People

Contributors

tigion avatar

Stargazers

Yuta Katayama avatar

Watchers

 avatar

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.