feat: GH-40 Add pattern to trigger_events (#42)

This commit is contained in:
Toni Müller
2023-11-08 09:30:21 +01:00
committed by GitHub
parent 610e72307d
commit 723168365b
5 changed files with 72 additions and 38 deletions
+18 -1
View File
@@ -119,9 +119,26 @@ EOF
}
```
### Trigger Events
The `trigger_events` field of the configuration allows the user to customize at which events **auto-save** saves.
While the default are very sane and should be enough for most usecases, finetuning for extended possibilities is supported.
It is also possible to pass a pattern to a trigger event, if you only want to execute the event on special file patterns:
``` lua
{
trigger_events = {
immediate_save = {
{ "BufLeave", pattern = {"*.c", "*.h"} }
}
}
}
```
### Condition
The condition field of the configuration allows the user to exclude **auto-save** from saving specific buffers.
The `condition` field of the configuration allows the user to exclude **auto-save** from saving specific buffers.
Here is an example using a helper function from `auto-save.utils.data` that disables auto-save for specified file types: