nix-community.nixvim/plugins/by-name/vim-suda/default.nix
osbm a41559f093
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Version info (push) Waiting to run
Documentation / Build (push) Blocked by required conditions
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions
treewide: add plugin descriptions
2025-06-24 06:10:11 +00:00

41 lines
1.2 KiB
Nix

{ lib, ... }:
let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.plugins.mkVimPlugin {
name = "vim-suda";
globalPrefix = "suda#";
description = "suda is a plugin to read or write files with sudo command.";
maintainers = [ lib.maintainers.marcel ];
settingsOptions = {
executable = defaultNullOpts.mkStr "sudo" ''
Path to the sudo binary.
'';
noninteractive = defaultNullOpts.mkFlagInt 0 ''
If set, suda will not prompt you for a password before saving a file.
It is supposed to support a setup with passwordless sudo or doas.
Use with care.
'';
prompt = defaultNullOpts.mkStr "Password: " ''
A prompt string used to ask password.
'';
smart_edit = defaultNullOpts.mkFlagInt 0 ''
If set, an `|autocmd|` is created that performs a heuristic check on
every buffer and decides whether to replace it with a suda buffer.
The check is done only once for every buffer and it is designed to be
optimized as possible so you shouldn't feel any slowdown when opening
buffers.
'';
};
settingsExample = {
path = "doas";
noninteractive = 1;
prompt = "Pass: ";
smart_edit = 1;
};
}