File tree 2 files changed +70
-0
lines changed
tests/test-sources/plugins/by-name/vim-suda
2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ { lib , helpers , ... } :
2
+
3
+ lib . nixvim . vim-plugin . mkVimPlugin {
4
+ name = "vim-suda" ;
5
+ globalPrefix = "suda#" ;
6
+ maintainers = [ lib . maintainers . marcel ] ;
7
+
8
+ settingsOptions = {
9
+ executable = helpers . defaultNullOpts . mkStr "sudo" ''
10
+ Path to the sudo binary.
11
+ '' ;
12
+
13
+ noninteractive = helpers . defaultNullOpts . mkFlagInt 0 ''
14
+ If set, suda will not prompt you for a password before saving a file.
15
+ It is supposed to support a setup with passwordless sudo or doas.
16
+ Use with care.
17
+ '' ;
18
+
19
+ prompt = helpers . defaultNullOpts . mkStr "Password: " ''
20
+ A prompt string used to ask password.
21
+ '' ;
22
+
23
+ # TODO: til https://github.com/lambdalisue/vim-suda/pull/84
24
+ # makes it into nixos-unstable
25
+ # NOTE: also update in `settingsExample` and test cases
26
+ #smart_edit = helpers.defaultNullOpts.mkFlagInt 0 ''
27
+ # If set, an `|autocmd|` is created that performs a heuristic check on
28
+ # every buffer and decides whether to replace it with a suda buffer.
29
+ # The check is done only once for every buffer and it is designed to be
30
+ # optimized as possible so you shouldn't feel any slowdown when opening
31
+ # buffers.
32
+ #'';
33
+ } ;
34
+
35
+ settingsExample = {
36
+ path = "doas" ;
37
+ noninteractive = 1 ;
38
+ prompt = "Pass: " ;
39
+ #smart_edit = 1;
40
+ } ;
41
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ empty = {
3
+ plugins . vim-suda . enable = true ;
4
+ } ;
5
+
6
+ defaults = {
7
+ plugins . vim-suda = {
8
+ enable = true ;
9
+ settings = {
10
+ path = "sudo" ;
11
+ noninteractive = 0 ;
12
+ prompt = "Password: " ;
13
+ #smart_edit = 0;
14
+ } ;
15
+ } ;
16
+ } ;
17
+
18
+ example = {
19
+ plugins . vim-suda = {
20
+ enable = true ;
21
+ settings = {
22
+ path = "doas" ;
23
+ noninteractive = 1 ;
24
+ prompt = "Pass: " ;
25
+ #smart_edit = 1;
26
+ } ;
27
+ } ;
28
+ } ;
29
+ }
You can’t perform that action at this time.
0 commit comments