mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-15 19:54:32 +02:00
plugins/utils: move to by-name
This commit is contained in:
parent
faff32b9f1
commit
52f125679f
195 changed files with 2 additions and 102 deletions
64
tests/test-sources/plugins/by-name/auto-save/default.nix
Normal file
64
tests/test-sources/plugins/by-name/auto-save/default.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
empty = {
|
||||
plugins.auto-save.enable = true;
|
||||
};
|
||||
|
||||
example = {
|
||||
plugins.auto-save = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
condition = ''
|
||||
function(buf)
|
||||
local fn = vim.fn
|
||||
local utils = require("auto-save.utils.data")
|
||||
|
||||
if utils.not_in(fn.getbufvar(buf, "&filetype"), {'oil'}) then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
'';
|
||||
write_all_buffers = true;
|
||||
debounce_delay = 1000;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
defaults = {
|
||||
plugins.auto-save = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
enabled = true;
|
||||
execution_message = {
|
||||
enabled = true;
|
||||
dim = 0.18;
|
||||
cleaning_interval = 1250;
|
||||
message.__raw = ''
|
||||
function()
|
||||
return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"))
|
||||
end
|
||||
'';
|
||||
};
|
||||
trigger_events = {
|
||||
immediate_save = [
|
||||
"BufLeave"
|
||||
"FocusLost"
|
||||
];
|
||||
defer_save = [
|
||||
"InsertLeave"
|
||||
"TextChanged"
|
||||
];
|
||||
cancel_defered_save = [ "InsertEnter" ];
|
||||
};
|
||||
condition = null;
|
||||
write_all_buffers = false;
|
||||
noautocmd = false;
|
||||
lockmarks = false;
|
||||
debounce_delay = 1000;
|
||||
debug = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue