mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/smartcolumn: init
This commit is contained in:
parent
fcb782cd9c
commit
accf5e67b1
2 changed files with 147 additions and 0 deletions
80
plugins/by-name/smartcolumn/default.nix
Normal file
80
plugins/by-name/smartcolumn/default.nix
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
inherit (lib.nixvim) defaultNullOpts;
|
||||||
|
inherit (lib) types;
|
||||||
|
in
|
||||||
|
lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
||||||
|
name = "smartcolumn";
|
||||||
|
originalName = "smartcolumn.nvim";
|
||||||
|
package = "smartcolumn-nvim";
|
||||||
|
|
||||||
|
maintainers = [ lib.maintainers.khaneliman ];
|
||||||
|
|
||||||
|
settingsOptions = {
|
||||||
|
colorcolumn = defaultNullOpts.mkNullable (with types; either str (listOf str)) "80" ''
|
||||||
|
Column with to highlight.
|
||||||
|
Supports multiple values for more column highlights.
|
||||||
|
'';
|
||||||
|
|
||||||
|
disabled_filetypes =
|
||||||
|
defaultNullOpts.mkListOf types.str
|
||||||
|
[
|
||||||
|
"help"
|
||||||
|
"text"
|
||||||
|
"markdown"
|
||||||
|
]
|
||||||
|
''
|
||||||
|
Filetypes that colorcolumn highlighting will not be displayed.
|
||||||
|
'';
|
||||||
|
|
||||||
|
scope =
|
||||||
|
defaultNullOpts.mkEnumFirstDefault
|
||||||
|
[
|
||||||
|
"file"
|
||||||
|
"window"
|
||||||
|
"line"
|
||||||
|
]
|
||||||
|
''
|
||||||
|
The scope to check for column width and highlight.
|
||||||
|
'';
|
||||||
|
|
||||||
|
custom_colorcolumn = defaultNullOpts.mkAttrsOf types.anything { } ''
|
||||||
|
Custom colorcolumn definitions for different filetypes.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
colorcolumn = "100";
|
||||||
|
disabled_filetypes = [
|
||||||
|
"checkhealth"
|
||||||
|
"help"
|
||||||
|
"lspinfo"
|
||||||
|
"markdown"
|
||||||
|
"neo-tree"
|
||||||
|
"noice"
|
||||||
|
"text"
|
||||||
|
];
|
||||||
|
custom_colorcolumn = {
|
||||||
|
go = [
|
||||||
|
"100"
|
||||||
|
"130"
|
||||||
|
];
|
||||||
|
java = [
|
||||||
|
"100"
|
||||||
|
"140"
|
||||||
|
];
|
||||||
|
nix = [
|
||||||
|
"100"
|
||||||
|
"120"
|
||||||
|
];
|
||||||
|
rust = [
|
||||||
|
"80"
|
||||||
|
"100"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
scope = "window";
|
||||||
|
};
|
||||||
|
}
|
67
tests/test-sources/plugins/by-name/smartcolumn/default.nix
Normal file
67
tests/test-sources/plugins/by-name/smartcolumn/default.nix
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
plugins.smartcolumn.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
default = {
|
||||||
|
plugins.smartcolumn = {
|
||||||
|
settings = {
|
||||||
|
colorcolumn = "80";
|
||||||
|
disabled_filetypes = [
|
||||||
|
"help"
|
||||||
|
"text"
|
||||||
|
"markdown"
|
||||||
|
];
|
||||||
|
scope = "file";
|
||||||
|
custom_colorcolumn = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
example = {
|
||||||
|
plugins.smartcolumn = {
|
||||||
|
settings = {
|
||||||
|
colorcolumn = "100";
|
||||||
|
disabled_filetypes = [
|
||||||
|
"checkhealth"
|
||||||
|
"help"
|
||||||
|
"lspinfo"
|
||||||
|
"markdown"
|
||||||
|
"neo-tree"
|
||||||
|
"noice"
|
||||||
|
"text"
|
||||||
|
];
|
||||||
|
custom_colorcolumn = {
|
||||||
|
go = [
|
||||||
|
"100"
|
||||||
|
"130"
|
||||||
|
];
|
||||||
|
java = [
|
||||||
|
"100"
|
||||||
|
"140"
|
||||||
|
];
|
||||||
|
nix = [
|
||||||
|
"100"
|
||||||
|
"120"
|
||||||
|
];
|
||||||
|
rust = [
|
||||||
|
"80"
|
||||||
|
"100"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
scope = "window";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
function-colorcolumn = {
|
||||||
|
plugins.smartcolumn = {
|
||||||
|
settings.custom_colorcolumn.__raw = ''
|
||||||
|
-- Supports custom logic from a function
|
||||||
|
function ()
|
||||||
|
return "100"
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue