All Projects â†’ Pocco81 â†’ AutoSave.nvim

Pocco81 / AutoSave.nvim

Licence: GPL-3.0 license
ðŸ§ķ Automatically save your changes in NeoVim

Programming Languages

lua
6591 projects
Makefile
30231 projects

Projects that are alternatives of or similar to AutoSave.nvim

borderlands3-save-editor
got tired trying to beat the katagawa ball^W^Wempowered scholar, and no accessible in-game console, so here we are
Stars: ✭ 36 (-89.68%)
Mutual labels:  save-editor, save-files
persistence.nvim
ðŸ’ū Simple session management for Neovim
Stars: ✭ 238 (-31.81%)
Mutual labels:  neovim-plugin
qf helper.nvim
A collection of improvements for the quickfix buffer
Stars: ✭ 70 (-79.94%)
Mutual labels:  neovim-plugin
fwatch.nvim
fwatch.nvim lets you watch files or directories for changes and then run vim commands or lua functions.
Stars: ✭ 57 (-83.67%)
Mutual labels:  neovim-plugin
package-info.nvim
✍ïļ All the npm/yarn commands I don't want to type
Stars: ✭ 248 (-28.94%)
Mutual labels:  neovim-plugin
bad-practices.nvim
A plugin to help give up bad practices in vim.
Stars: ✭ 41 (-88.25%)
Mutual labels:  neovim-plugin
sphinx.nvim
Sphinx integrations for Neovim
Stars: ✭ 64 (-81.66%)
Mutual labels:  neovim-plugin
trouble.nvim
ðŸšĶ A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Stars: ✭ 2,663 (+663.04%)
Mutual labels:  neovim-plugin
nvim-config
My neovim config
Stars: ✭ 63 (-81.95%)
Mutual labels:  neovim-plugin
skim.vim
vim support for skim
Stars: ✭ 127 (-63.61%)
Mutual labels:  neovim-plugin
cmp-tmux
Tmux completion source for nvim-cmp and nvim-compe
Stars: ✭ 98 (-71.92%)
Mutual labels:  neovim-plugin
auto-session
A small automated session manager for Neovim
Stars: ✭ 688 (+97.13%)
Mutual labels:  neovim-plugin
nvim-cheat.sh
cheat.sh integration for neovim in elegant way
Stars: ✭ 130 (-62.75%)
Mutual labels:  neovim-plugin
ftFT.nvim
I love highlights! I love f{char}!
Stars: ✭ 28 (-91.98%)
Mutual labels:  neovim-plugin
modes.nvim
Prismatic line decorations for the adventurous vim user
Stars: ✭ 299 (-14.33%)
Mutual labels:  neovim-plugin
discord-downloader-go
A Discord bot program to download and otherwise handle files sent in Discord channels with extensive configuration. Can be used as a genuine Discord Bot or user account / self-bot
Stars: ✭ 169 (-51.58%)
Mutual labels:  save-files
D3Edit
A script to encrypt/decrypt and modify Diablo III saves
Stars: ✭ 35 (-89.97%)
Mutual labels:  save-editor
buftabline.nvim
A low-config, minimalistic buffer tabline Neovim plugin written in Lua.
Stars: ✭ 74 (-78.8%)
Mutual labels:  neovim-plugin
nvim-lsp-ts-utils
Utilities to improve the TypeScript development experience for Neovim's built-in LSP client.
Stars: ✭ 437 (+25.21%)
Mutual labels:  neovim-plugin
stable-windows
Keeps vim windows stable on layout changes
Stars: ✭ 41 (-88.25%)
Mutual labels:  neovim-plugin

ðŸ§ķ auto-save.nvim

Automatically save your changes in NeoVim

Stars Issues Repo Size

 

ðŸ“Ē Disclaimer: Breaking Change

This plugin has been renamed from AutoSave to auto-save, and this repository has accordingly moved from pocco81/AutoSave.nvim to pocco81/auto-save.nvim. To prevent errors with your configuration, make sure to update both the name and the repository url in your config!

 

📋 Features

  • automatically save your changes so the world doesn't collapse
  • highly customizable:
    • conditionals to assert whether to save or not
    • execution message (it can be dimmed and personalized)
    • events that trigger auto-save
  • debounce the save with a delay
  • multiple callbacks
  • automatically clean the message area

 

📚 Requirements

  • Neovim >= 0.5.0

 

ðŸ“Ķ Installation

Install the plugin with your favourite package manager:

Packer.nvim
use({
	"Pocco81/auto-save.nvim",
	config = function()
		 require("auto-save").setup {
			-- your config goes here
			-- or just leave it empty :)
		 }
	end,
})
vim-plug
Plug 'Pocco81/auto-save.nvim'
lua << EOF
	require("auto-save").setup {
		-- your config goes here
		-- or just leave it empty :)
	}
EOF

 

⚙ïļ Configuration

auto-save comes with the following defaults:

{
    enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
    execution_message = {
		message = function() -- message to print on save
			return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"))
		end,
		dim = 0.18, -- dim the color of `message`
		cleaning_interval = 1250, -- (milliseconds) automatically clean MsgArea after displaying `message`. See :h MsgArea
	},
    trigger_events = {"InsertLeave", "TextChanged"}, -- vim events that trigger auto-save. See :h events
	-- function that determines whether to save the current buffer or not
	-- return true: if buffer is ok to be saved
	-- return false: if it's not ok to be saved
	condition = function(buf)
		local fn = vim.fn
		local utils = require("auto-save.utils.data")

		if
			fn.getbufvar(buf, "&modifiable") == 1 and
			utils.not_in(fn.getbufvar(buf, "&filetype"), {}) then
			return true -- met condition(s), can save
		end
		return false -- can't save
	end,
    write_all_buffers = false, -- write all buffers when the current one meets `condition`
    debounce_delay = 135, -- saves the file at most every `debounce_delay` milliseconds
	callbacks = { -- functions to be executed at different intervals
		enabling = nil, -- ran when enabling auto-save
		disabling = nil, -- ran when disabling auto-save
		before_asserting_save = nil, -- ran before checking `condition`
		before_saving = nil, -- ran before doing the actual save
		after_saving = nil -- ran after doing the actual save
	}
}

Additionally you may want to set up a key mapping to toggle auto-save:

vim.api.nvim_set_keymap("n", "<leader>n", ":ASToggle<CR>", {})

 

ðŸŠī Usage

Besides running auto-save at startup (if you have enabled = true in your config), you may as well:

  • ASToggle: toggle auto-save

 

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].