Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

ecthelionvi/NeoSave.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 

Repository files navigation

💾 NeoSave.nvim

Lua Neovim

demo

📢 Introduction

NeoSave is a Neovim plugin that automatically saves your files as you edit, ensuring your progress is preserved. Configure NeoSave to save either the current buffer or all open buffers, and easily toggle auto-saving on and off.

✨ Features

  • Save all open buffers or only the current buffer.
  • Auto-save files upon modification.
  • Toggle auto-saving off and on.

💽 Persistence

NeoSave remembers the auto-save state across sessions.

🔔 Default Behavior

NeoSave is enabled by default. To toggle it off and on for specific files, see below.

🛠️ Usage

To toggle NeoSave off and on, you can use the ToggleNeoSave command:

:ToggleNeoSave

You can also create a keybinding to toggle NeoSave more conveniently:

vim.keymap.set("n", "<leader>s", "<cmd>ToggleNeoSave<cr>", { noremap = true, silent = true })

To clear the list of disabled files, you can use the ClearNeoSave command:

:ClearNeoSave

📦 Installation

  1. Install via your favorite package manager.
{
  "ecthelionvi/NeoSave.nvim",
  opts = {}
},
use "ecthelionvi/NeoSave.nvim"
  1. Setup the plugin in your init.lua. This step is not needed with lazy.nvim if opts is set as above.
require("NeoSave").setup()

🔧 Configuration

Pass your config table into the setup() function or opts with lazy.nvim.

The available options:

  • write_all_bufs (boolean): save all open buffers or only the current buffer
    • false (default)

Default Config

local config = {
  write_all_bufs = false,
}

About

Neovim plugin for auto-saving with buffer options and toggle.

Topics

Resources

License

Stars

Watchers

Forks

Languages