mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
treewide: begin restructuring the module tree
This commit is contained in:
parent
e1835f6c46
commit
7c730a78e5
254 changed files with 749 additions and 664 deletions
21
modules/plugins/ui/smartcolumn/config.nix
Normal file
21
modules/plugins/ui/smartcolumn/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.ui.smartcolumn;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["smartcolumn"];
|
||||
|
||||
luaConfigRC.smartcolumn = entryAnywhere ''
|
||||
require("smartcolumn").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/ui/smartcolumn/default.nix
Normal file
6
modules/plugins/ui/smartcolumn/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./smartcolumn.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
48
modules/plugins/ui/smartcolumn/smartcolumn.nix
Normal file
48
modules/plugins/ui/smartcolumn/smartcolumn.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) nullOr int str attrsOf either listOf;
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
imports = let
|
||||
renamedSetupOpt = oldPath: newPath:
|
||||
mkRenamedOptionModule (["vim" "ui" "smartcolumn"] ++ oldPath) (["vim" "ui" "smartcolumn" "setupOpts"] ++ newPath);
|
||||
in [
|
||||
(renamedSetupOpt ["disabledFiletypes"] ["disabled_filetypes"])
|
||||
(renamedSetupOpt ["showColumnAt"] ["colorcolumn"])
|
||||
(renamedSetupOpt ["columnAt" "languages"] ["custom_colorcolumn"])
|
||||
];
|
||||
|
||||
options.vim.ui.smartcolumn = {
|
||||
enable = mkEnableOption "line length indicator";
|
||||
|
||||
setupOpts = mkPluginSetupOption "smartcolumn.nvim" {
|
||||
colorcolumn = mkOption {
|
||||
type = nullOr (either str (listOf str));
|
||||
default = "120";
|
||||
description = "The position at which the column will be displayed. Set to null to disable";
|
||||
};
|
||||
|
||||
disabled_filetypes = mkOption {
|
||||
type = listOf str;
|
||||
default = ["help" "text" "markdown" "NvimTree" "alpha"];
|
||||
description = "The filetypes smartcolumn will be disabled for.";
|
||||
};
|
||||
|
||||
custom_colorcolumn = mkOption {
|
||||
description = "The position at which smart column should be displayed for each individual buffer type";
|
||||
type = attrsOf (either int (listOf int));
|
||||
default = {};
|
||||
|
||||
example = literalExpression ''
|
||||
vim.ui.smartcolumn.setupOpts.custom_colorcolumn = {
|
||||
nix = 110;
|
||||
ruby = 120;
|
||||
java = 130;
|
||||
go = [90 130];
|
||||
};
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue