Skip to content

yukimemi/silentsaver.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

silentsaver.vim

Auto file backup silently.

Features

silentsaver.vim is a Vim plugin that automatically backup files.

Installation

If you use folke/lazy.nvim.

{
  "yukimemi/silentsaver.vim",
  lazy = false,
  dependencies = {
    "vim-denops/denops.vim",
  },
}

If you use yukimemi/dvpm.

dvpm.add({ url: "yukimemi/silentsaver.vim" });

Requirements

Usage

No special settings are required. By default, auto backup current buffer on CursorHold and BufWritePre.

Commands

:DisableSilentSaver Disable auto backup.

:EnableSilentSaver Enable auto backup.

:OpenSilentSaver Show list of backed up files with quickfix.

Config

No settings are required. However, the following settings can be made if necessary.

g:silentsaver_debug Enable debug messages. default is v:false

g:silentsaver_ignore_filetypes A list of filetypes to be ignored. default is ["log"]

g:silentsaver_echo Whether to output echo messages during backup. default is v:true

g:silentsaver_notify Whether to vim.notify messages during backup. (Neovim only) default is v:false

g:silentsaver_dir Backup directory. default is ~/.cache/silentsaver

g:silentsaver_events Event lists to do backup. default is ["CursorHold", "BufWritePre"]

Example

let g:silentsaver_debug = v:false
let g:silentsaver_echo = v:false
let g:silentsaver_notify = v:true
let g:silentsaver_dir = "~/.cache/silentsaver"
let g:silentsaver_events = ["CursorHold", "BufWritePre", "BufRead"]
let g:silentsaver_ignore_filetypes = ["csv", "log"]

License

Licensed under MIT License.

Copyright (c) 2023 yukimemi