mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-14 17:35:31 +00:00
utility/trim-nvim: init
This commit is contained in:
parent
bc978c4fad
commit
bc709de853
7 changed files with 66 additions and 0 deletions
|
|
@ -179,6 +179,7 @@ isMaximal: {
|
||||||
surround.enable = isMaximal;
|
surround.enable = isMaximal;
|
||||||
leetcode-nvim.enable = isMaximal;
|
leetcode-nvim.enable = isMaximal;
|
||||||
multicursors.enable = isMaximal;
|
multicursors.enable = isMaximal;
|
||||||
|
trim-nvim.enable = true;
|
||||||
|
|
||||||
motion = {
|
motion = {
|
||||||
hop.enable = true;
|
hop.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -211,6 +211,7 @@
|
||||||
- Add formatters for go: [gofmt](https://go.dev/blog/gofmt),
|
- Add formatters for go: [gofmt](https://go.dev/blog/gofmt),
|
||||||
[golines](https://github.com/segmentio/golines) and
|
[golines](https://github.com/segmentio/golines) and
|
||||||
[gofumpt](https://github.com/mvdan/gofumpt).
|
[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)
|
[UltraGhostie](https://github.com/UltraGhostie)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
./snacks-nvim
|
./snacks-nvim
|
||||||
./surround
|
./surround
|
||||||
./telescope
|
./telescope
|
||||||
|
./trim-nvim
|
||||||
./wakatime
|
./wakatime
|
||||||
./yanky-nvim
|
./yanky-nvim
|
||||||
./yazi-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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2087,6 +2087,18 @@
|
||||||
"url": "https://github.com/folke/tokyonight.nvim/archive/057ef5d260c1931f1dffd0f052c685dcd14100a3.tar.gz",
|
"url": "https://github.com/folke/tokyonight.nvim/archive/057ef5d260c1931f1dffd0f052c685dcd14100a3.tar.gz",
|
||||||
"hash": "002rzmdxq45bdyd27i8k8lhdcwxn9l4v6x5cm6g7v1213m0n25np"
|
"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": {
|
"trouble": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue