utility/trim-nvim: init

This commit is contained in:
Ben Mayer 2025-03-17 13:05:47 +01:00
parent bc978c4fad
commit bc709de853
No known key found for this signature in database
7 changed files with 66 additions and 0 deletions

View file

@ -179,6 +179,7 @@ isMaximal: {
surround.enable = isMaximal;
leetcode-nvim.enable = isMaximal;
multicursors.enable = isMaximal;
trim-nvim.enable = true;
motion = {
hop.enable = true;

View file

@ -211,6 +211,7 @@
- Add formatters for go: [gofmt](https://go.dev/blog/gofmt),
[golines](https://github.com/segmentio/golines) and
[gofumpt](https://github.com/mvdan/gofumpt).
- Add [trim-nvim](https://github.com/cappyzawa/trim.nvim) for removing trailing spaces and lines
[UltraGhostie](https://github.com/UltraGhostie)

View file

@ -20,6 +20,7 @@
./snacks-nvim
./surround
./telescope
./trim-nvim
./wakatime
./yanky-nvim
./yazi-nvim

View 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});
'';
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./config.nix
./trim-nvim.nix
];
}

View 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";
};
};
};
}

View file

@ -2087,6 +2087,18 @@
"url": "https://github.com/folke/tokyonight.nvim/archive/057ef5d260c1931f1dffd0f052c685dcd14100a3.tar.gz",
"hash": "002rzmdxq45bdyd27i8k8lhdcwxn9l4v6x5cm6g7v1213m0n25np"
},
"trim-nvim": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "cappyzawa",
"repo": "trim.nvim"
},
"branch": "master",
"revision": "d0760a840ca2fe4958353dee567a90c2994e70a7",
"url": "https://github.com/cappyzawa/trim.nvim/archive/d0760a840ca2fe4958353dee567a90c2994e70a7.tar.gz",
"hash": "0xy21z4yxpdi1g9yl744582fkmz8q1pap9czknzp8w4ws5mhi709"
},
"trouble": {
"type": "Git",
"repository": {