neovim: refac line limiter
This commit is contained in:
parent
9cda7b1c76
commit
b9fe063b50
1 changed files with 8 additions and 6 deletions
|
@ -4,15 +4,17 @@ let
|
||||||
inherit (lib.mod) ctrl;
|
inherit (lib.mod) ctrl;
|
||||||
inherit (lib.nix2lua) pipe1 require call call0 nf var;
|
inherit (lib.nix2lua) pipe1 require call call0 nf var;
|
||||||
|
|
||||||
|
mkLineLimiterOpts = limit: {
|
||||||
|
colorcolumn = toString (limit + 1);
|
||||||
|
textwidth = limit;
|
||||||
|
};
|
||||||
|
|
||||||
mkLineLimiterGroup = { limit, pattern }:
|
mkLineLimiterGroup = { limit, pattern }:
|
||||||
lib.nameValuePair
|
lib.nameValuePair
|
||||||
"line-limiter-${toString limit}"
|
"line-limiter-${toString limit}"
|
||||||
{
|
{
|
||||||
inherit pattern;
|
inherit pattern;
|
||||||
opt = {
|
opt = mkLineLimiterOpts limit;
|
||||||
colorcolumn = toString limit;
|
|
||||||
textwidth = limit - 1;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -28,7 +30,7 @@ in
|
||||||
|
|
||||||
buffer.filetype = lib.listToAttrs [
|
buffer.filetype = lib.listToAttrs [
|
||||||
(mkLineLimiterGroup {
|
(mkLineLimiterGroup {
|
||||||
limit = 101;
|
limit = 100;
|
||||||
pattern = [
|
pattern = [
|
||||||
"nix"
|
"nix"
|
||||||
"javascript,javascriptreact"
|
"javascript,javascriptreact"
|
||||||
|
@ -38,7 +40,7 @@ in
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
(mkLineLimiterGroup {
|
(mkLineLimiterGroup {
|
||||||
limit = 81;
|
limit = 80;
|
||||||
pattern = [
|
pattern = [
|
||||||
"python"
|
"python"
|
||||||
"json"
|
"json"
|
||||||
|
|
Loading…
Reference in a new issue