Skip to content

Commit 4df5746

Browse files
refaelshGaetanLepage
authored andcommitted
plugins/vim-autosource: init
1 parent 9248da3 commit 4df5746

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

plugins/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
./utils/auto-save.nix
154154
./utils/auto-session.nix
155155
./utils/autoclose.nix
156+
./utils/autosource.nix
156157
./utils/bacon.nix
157158
./utils/baleia.nix
158159
./utils/better-escape.nix

plugins/utils/autosource.nix

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
lib,
3+
...
4+
}:
5+
let
6+
inherit (lib.nixvim) defaultNullOpts;
7+
mkBoolInt = defaultNullOpts.mkEnum [
8+
0
9+
1
10+
];
11+
in
12+
lib.nixvim.vim-plugin.mkVimPlugin {
13+
name = "autosource";
14+
originalName = "vim-autosource";
15+
package = "vim-autosource";
16+
globalPrefix = "autosource_";
17+
18+
maintainers = [ lib.nixvim.maintainers.refaelsh ];
19+
20+
settingsOptions = {
21+
prompt_for_new_file = mkBoolInt 1 ''
22+
The primary use-case of this option is to support automated testing.
23+
When set to false AutoSource will not prompt you when it detects a new file. The file will *NOT* be sourced.
24+
'';
25+
26+
prompt_for_changed_file = mkBoolInt 1 ''
27+
The primary use-case of this option is to support automated testing.
28+
When set to false AutoSource will not prompt you when it detects when a file is changed. The file will NOT be sourced.
29+
'';
30+
};
31+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
empty = {
3+
plugins.autosource.enable = true;
4+
};
5+
6+
defaults = {
7+
plugins.autosource = {
8+
enable = true;
9+
10+
settings = {
11+
prompt_for_new_file = 1;
12+
prompt_for_changed_file = 1;
13+
};
14+
};
15+
};
16+
}

0 commit comments

Comments
 (0)