Save file content to redis for later restore after saving the file.
Your files could be accidently removed (by something like rm -rf
git reset
),
you can't get it back easily unless you have swap file, but no one want to have
swap file in their code base, so keep.nvim comes for help, it automatic store
file content associate with file path into redis, and you could restore them by
a simple command.
Take vim-plug for example:
Plug 'neoclide/keep.nvim', {do: 'npm install'}
Run :UpdateRemotePlugins
in vim after installation.
-
Denite keep
find removed files that stored in keep based on CWD, you can doreset
action to restore the file. You should have dentie.nvim installed to use this feature -
:KeepRestore [filepath]
restore the content of current file or filepath resolved from CWD of neovim. -
KeepRemovedFiles([directory])
a helper function to get removed files array based on directory (or current cwd if not specified)
g:nvim_keep_redis_host
, default to127.0.0.1
g:nvim_keep_redis_port
, default to6379
g:nvim_keep_redis_expire
, default to5*24*3600
(5 days)