mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-15 18:05:32 +00:00
utility/trim-nvim: init
This commit is contained in:
parent
bc978c4fad
commit
bc709de853
7 changed files with 66 additions and 0 deletions
|
|
@ -20,6 +20,7 @@
|
|||
./snacks-nvim
|
||||
./surround
|
||||
./telescope
|
||||
./trim-nvim
|
||||
./wakatime
|
||||
./yanky-nvim
|
||||
./yazi-nvim
|
||||
|
|
|
|||
21
modules/plugins/utility/trim-nvim/config.nix
Normal file
21
modules/plugins/utility/trim-nvim/config.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.utility.trim-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["trim-nvim"];
|
||||
|
||||
pluginRC.trim-nvim = entryAnywhere ''
|
||||
require('trim').setup(${toLuaObject cfg.setupOpts});
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/plugins/utility/trim-nvim/default.nix
Normal file
6
modules/plugins/utility/trim-nvim/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./trim-nvim.nix
|
||||
];
|
||||
}
|
||||
24
modules/plugins/utility/trim-nvim/trim-nvim.nix
Normal file
24
modules/plugins/utility/trim-nvim/trim-nvim.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) listOf str bool;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.utility.trim-nvim = {
|
||||
enable = mkEnableOption ''
|
||||
automatic removal of trailing whitespaces and lines [trim-nvim]
|
||||
'';
|
||||
|
||||
setupOpts = mkPluginSetupOption "trim-nvim" {
|
||||
ft_blocklist = mkOption {
|
||||
type = listOf str;
|
||||
default = ["markdown"];
|
||||
description = "List of filetypes to not trim";
|
||||
};
|
||||
highlight = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Enable highlighting trailing spaces";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue