Home

Awesome

<img src="https://neovim.io/logos/neovim-mark-flat.png" align="right" width="100" />

suave.lua

suave.lua aims to be a minimal, beginner-friendly project session automation plugin for NeoVim beginners.

(The name SUAVE is a quasi-acronym of "Session in LUA for Vim Enthusiasts".)

Intro.

https://user-images.githubusercontent.com/24765272/217663121-7880060f-728c-463f-9063-ecdbafb00a06.mov

suave.lua is all about project session automation, it can:

Now you can:

Manual

Addons:

Setup Example

Notes for different plugin managers:

use {
  'nyngwang/suave.lua',
  config = function ()
    require('suave').setup {
      -- menu_height = 6,
      auto_save = {
        enabled = true,
        -- exclude_filetypes = {},
      },
      store_hooks = {
        -- WARN: DON'T call `vim.cmd('wa')` here. Use `setup.auto_save` instead. (See #4)
        before_mksession = {
          -- function ()
          --   -- `rcarriga/nvim-dap-ui`.
          --   require('dapui').close()
          -- end,
          -- function ()
          --   -- `nvim-neo-tree/neo-tree.nvim`.
          --   for _, w in ipairs(vim.api.nvim_list_wins()) do
          --     if vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(w), 'ft') == 'neo-tree' then
          --       vim.api.nvim_win_close(w, false)
          --     end
          --   end
          -- end,
        },
        after_mksession = {
          -- NOTE: the `data` param is Lua table, which will be stored in json format under `.suave/` folder.
          function (data)
            -- store current colorscheme.
            data.colorscheme = vim.g.colors_name
          end,
        },
      },
      restore_hooks = {
        after_source = {
          function (data)
            if not data then return end
            -- restore colorscheme.
            vim.cmd(string.format([[
              color %s
              doau ColorScheme %s
            ]], data.colorscheme, data.colorscheme))
          end,
        },
      }
    }
  end
}