mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-05 18:01:32 +00:00
feat: implement freeform smartcolumn column positions
This commit is contained in:
parent
c6bcc873a6
commit
2cfeb22764
5 changed files with 48 additions and 38 deletions
|
@ -18,13 +18,7 @@ in {
|
|||
colorcolumn = "${toString cfg.showColumnAt}",
|
||||
-- { "help", "text", "markdown", "NvimTree", "alpha"},
|
||||
disabled_filetypes = { ${concatStringsSep ", " (map (x: "\"" + x + "\"") cfg.disabledFiletypes)} },
|
||||
custom_colorcolumn = {
|
||||
-- TODO: use cfg.languages.<language>.columnAt when it's fixed to dynamically define per-language length
|
||||
ruby = "120",
|
||||
java = "120",
|
||||
nix = "120",
|
||||
markdown = "80",
|
||||
},
|
||||
custom_colorcolumn = ${nvim.lua.attrsetToLuaTable cfg.columnAt.languages},
|
||||
scope = "file",
|
||||
})
|
||||
'';
|
||||
|
|
|
@ -1,19 +1,8 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{lib, ...}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
languageOpts = {
|
||||
columnAt = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = 80;
|
||||
};
|
||||
};
|
||||
in {
|
||||
with builtins; {
|
||||
options.vim.ui.smartcolumn = {
|
||||
enable = mkEnableOption "Enable smartcolumn line length indicator";
|
||||
enable = mkEnableOption "Enable Smartcolumn line length indicator";
|
||||
|
||||
showColumnAt = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
|
@ -27,15 +16,15 @@ in {
|
|||
description = "The filetypes smartcolumn will be disabled for.";
|
||||
};
|
||||
|
||||
/*
|
||||
languages = mkOption {
|
||||
default = {};
|
||||
description = "Language specific configuration.";
|
||||
type = with types;
|
||||
attrsOf (submodule {
|
||||
options = languageOpts;
|
||||
});
|
||||
columnAt = {
|
||||
# TODO: the current implementation only allows for options such as { ruby = "120", java = "120" }
|
||||
# whereas the lua config would allow { ruby = "120", java = { "180", "200"} }, this needs to be fixed in the custom lib
|
||||
languages = lib.mkOption {
|
||||
description = "The position at which smart column should be displayed for each individual buffer type";
|
||||
type = lib.types.submodule {
|
||||
freeformType = with lib.types; attrsOf int;
|
||||
};
|
||||
};
|
||||
};
|
||||
*/
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue