Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

trevin-j/tmux-resurrect-nvim

Open more actions menu
 
 

Repository files navigation

Tmux Resurrect - Nvim Fork!

What's New in This Fork 🚀

This fork of tmux-resurrection brings a smoother, more efficient workflow for Neovim users who want their sessions seamlessly integrated with tmux! 😎

Key Features:

  • ✨ Neovim Session Support: This version adds automatic support for persistence.nvim, which means your Neovim sessions will now load and restore automatically with tmux. Other session managers should work, but persistence.nvim is the only one that's been tested so far. Don’t worry if yours isn’t supported — it’s likely easy to add!

  • 💾 Autosave Your Session: To make sure your session is always up to date, you’ll want to save frequently. We recommend adding this autocmd to your init.lua or init.vim for auto-saving:

    vim.api.nvim_create_autocmd(
      { "BufWinLeave", "BufWritePost", "WinLeave", "TabLeave" },
      {
        group = vim.api.nvim_create_augroup("PersistenceAutoSave", { clear = true }),
        callback = function()
          require("persistence").save()
        end,
      }
    )

    This will ensure that your session saves whenever you switch buffers, windows, or tabs — no more worrying about losing progress! 💾✨

  • 🛠️ Future Git Branch Saving: Right now, git branch saves aren’t supported, but it’s on the way! Stay tuned for this feature in the near future. 📅

With these updates, tmux and Neovim will work together like never before — saving you time, keeping your sessions safe, and making your workflow smoother. Enjoy the ride! 🚀

P.S. It works great with Tmux Continuum!

Tmux Resurrect

Restore tmux environment after system restart.

Tmux is great, except when you have to restart the computer. You lose all the running programs, working directories, pane layouts etc. There are helpful management tools out there, but they require initial configuration and continuous updates as your workflow evolves or you start new projects.

tmux-resurrect saves all the little details from your tmux environment so it can be completely restored after a system restart (or when you feel like it). No configuration is required. You should feel like you never quit tmux.

It even (optionally) restores vim and neovim sessions!

Automatic restoring and continuous saving of tmux env is also possible with tmux-continuum plugin.

Screencast

screencast screenshot

Key bindings

  • prefix + Ctrl-s - save
  • prefix + Ctrl-r - restore

About

This plugin goes to great lengths to save and restore all the details from your tmux environment. Here's what's been taken care of:

  • all sessions, windows, panes and their order
  • current working directory for each pane
  • exact pane layouts within windows (even when zoomed)
  • active and alternative session
  • active and alternative window for each session
  • windows with focus
  • active pane for each window
  • "grouped sessions" (useful feature when using tmux with multiple monitors)
  • programs running within a pane! More details in the restoring programs doc.

Optional:

Requirements / dependencies: tmux 1.9 or higher, bash.

Tested and working on Linux, OSX and Cygwin.

tmux-resurrect is idempotent! It will not try to restore panes or windows that already exist.
The single exception to this is when tmux is started with only 1 pane in order to restore previous tmux env. Only in this case will this single pane be overwritten.

Installation with Tmux Plugin Manager (recommended)

Add plugin to the list of TPM plugins in .tmux.conf:

set -g @plugin 'trevin-j/tmux-resurrect-nvim'

Hit prefix + I to fetch the plugin and source it. You should now be able to use the plugin.

Manual Installation

Clone the repo:

$ git clone https://github.com/trevin-j/tmux-resurrect-nvim.git ~/clone/path

Add this line to the bottom of .tmux.conf:

run-shell ~/clone/path/resurrect.tmux

Reload TMUX environment with: $ tmux source-file ~/.tmux.conf. You should now be able to use the plugin.

Docs

Configuration

Optional features

Other goodies

  • tmux-copycat - a plugin for regex searches in tmux and fast match selection
  • tmux-yank - enables copying highlighted text to system clipboard
  • tmux-open - a plugin for quickly opening highlighted file or a url
  • tmux-continuum - automatic restoring and continuous saving of tmux env

Reporting bugs and contributing

Both contributing and bug reports are welcome. Please check out contributing guidelines.

Credits

Mislav Marohnić - the idea for the plugin came from his tmux-session script.

License

MIT

About

Persists tmux environment across system restarts. Modified to better support modern nvim session managers.

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.