mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-02 17:15:55 +00:00
modules: start breaking down core modules; simplify tree structure
This commit is contained in:
parent
4703ed7731
commit
370913e827
242 changed files with 178 additions and 124 deletions
26
modules/plugins/ui/smartcolumn/config.nix
Normal file
26
modules/plugins/ui/smartcolumn/config.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim concatStringsSep;
|
||||
|
||||
cfg = config.vim.ui.smartcolumn;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"smartcolumn"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.smartcolumn = nvim.dag.entryAnywhere ''
|
||||
require("smartcolumn").setup({
|
||||
colorcolumn = "${toString cfg.showColumnAt}",
|
||||
-- { "help", "text", "markdown", "NvimTree", "alpha"},
|
||||
disabled_filetypes = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.disabledFiletypes)} },
|
||||
custom_colorcolumn = ${nvim.lua.attrsetToLuaTable cfg.columnAt.languages},
|
||||
scope = "file",
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
||||
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
|
||||
];
|
||||
}
|
||||
37
modules/plugins/ui/smartcolumn/smartcolumn.nix
Normal file
37
modules/plugins/ui/smartcolumn/smartcolumn.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption mkOption types literalExpression;
|
||||
in {
|
||||
options.vim.ui.smartcolumn = {
|
||||
enable = mkEnableOption "line length indicator";
|
||||
|
||||
showColumnAt = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = 120;
|
||||
description = "The position at which the column will be displayed. Set to null to disable";
|
||||
};
|
||||
|
||||
disabledFiletypes = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = ["help" "text" "markdown" "NvimTree" "alpha"];
|
||||
description = "The filetypes smartcolumn will be disabled for.";
|
||||
};
|
||||
|
||||
columnAt = {
|
||||
languages = mkOption {
|
||||
description = "The position at which smart column should be displayed for each individual buffer type";
|
||||
type = types.submodule {
|
||||
freeformType = with types; attrsOf (either int (listOf int));
|
||||
};
|
||||
|
||||
example = literalExpression ''
|
||||
vim.ui.smartcolumn.columnAt.languages = {
|
||||
nix = 110;
|
||||
ruby = 120;
|
||||
java = 130;
|
||||
go = [90 130];
|
||||
};
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue