mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
Compare commits
39 commits
9b111d1fe4
...
8f1b38ee81
Author | SHA1 | Date | |
---|---|---|---|
8f1b38ee81 | |||
c0d40cb75b | |||
499d5c2679 | |||
8a98147d5b | |||
e89f074c09 | |||
969ab14046 | |||
af07e1084a | |||
84613262f0 | |||
ffbcebbb4e | |||
38f534f6d8 | |||
bd66a784db | |||
b5ea366433 | |||
550cc787c5 | |||
119a902ddb | |||
71b1aa850c | |||
5745ff6bcd | |||
711de1179c | |||
a8874e8855 | |||
f402e870eb | |||
b2dadb217a | |||
d3d5bbec92 | |||
3af7e4416e | |||
a42a4a4fb6 | |||
7a0e7739c5 | |||
|
715408d2bd | ||
|
1604c7423f | ||
|
dfdad4c2ce | ||
43e3663b2b | |||
|
b302e151e1 | ||
0ba3ccdab8 | |||
|
1bd0ae5f7e | ||
57067e85ed | |||
1b16c6b19f | |||
a6bb6e1b3e | |||
b3f51048db | |||
|
8997e62b3b | ||
82c2d4bdd0 | |||
1badee81db | |||
383924d225 |
53 changed files with 1318 additions and 829 deletions
|
@ -46,6 +46,8 @@ isMaximal: {
|
||||||
|
|
||||||
nix.enable = true;
|
nix.enable = true;
|
||||||
|
|
||||||
|
# Assembly is not common, and the asm LSP is a major hit-or-miss
|
||||||
|
assembly.enable = false;
|
||||||
markdown.enable = isMaximal;
|
markdown.enable = isMaximal;
|
||||||
html.enable = isMaximal;
|
html.enable = isMaximal;
|
||||||
css.enable = isMaximal;
|
css.enable = isMaximal;
|
||||||
|
@ -77,20 +79,17 @@ isMaximal: {
|
||||||
};
|
};
|
||||||
|
|
||||||
visuals = {
|
visuals = {
|
||||||
enable = true;
|
nvim-scrollbar.enable = isMaximal;
|
||||||
nvimWebDevicons.enable = true;
|
nvim-web-devicons.enable = true;
|
||||||
scrollBar.enable = isMaximal;
|
nvim-cursorline.enable = true;
|
||||||
smoothScroll.enable = true;
|
cinnamon-nvim.enable = true;
|
||||||
cellularAutomaton.enable = false;
|
|
||||||
fidget-nvim.enable = true;
|
fidget-nvim.enable = true;
|
||||||
|
|
||||||
highlight-undo.enable = true;
|
highlight-undo.enable = true;
|
||||||
|
indent-blankline.enable = true;
|
||||||
|
|
||||||
indentBlankline.enable = true;
|
# Fun
|
||||||
|
cellular-automaton.enable = false;
|
||||||
cursorline = {
|
|
||||||
enable = true;
|
|
||||||
lineTimeout = 0;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
statusline = {
|
statusline = {
|
||||||
|
@ -164,6 +163,7 @@ isMaximal: {
|
||||||
motion = {
|
motion = {
|
||||||
hop.enable = true;
|
hop.enable = true;
|
||||||
leap.enable = true;
|
leap.enable = true;
|
||||||
|
precognition.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
images = {
|
images = {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
|
fetchzip,
|
||||||
|
runCommandLocal,
|
||||||
# build inputs
|
# build inputs
|
||||||
nixos-render-docs,
|
nixos-render-docs,
|
||||||
documentation-highlighter,
|
documentation-highlighter,
|
||||||
|
@ -11,6 +13,25 @@
|
||||||
optionsJSON,
|
optionsJSON,
|
||||||
} @ args: let
|
} @ args: let
|
||||||
manual-release = args.release or "unstable";
|
manual-release = args.release or "unstable";
|
||||||
|
|
||||||
|
scss-reset = fetchzip {
|
||||||
|
url = "https://github.com/Frontend-Layers/scss-reset/archive/refs/tags/1.4.2.zip";
|
||||||
|
hash = "sha256-cif5Sx8Ca5vxdw/mNAgpulLH15TwmzyJFNM7JURpoaE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
compileStylesheet = runCommandLocal "compile-nvf-stylesheet" {} ''
|
||||||
|
mkdir -p $out
|
||||||
|
|
||||||
|
tmpfile=$(mktemp -d)
|
||||||
|
trap "rm -r $tmpfile" EXIT
|
||||||
|
|
||||||
|
ln -s "${scss-reset}/build" "$tmpfile/scss-reset"
|
||||||
|
|
||||||
|
${dart-sass}/bin/sass --load-path "$tmpfile" \
|
||||||
|
${./static/style.scss} "$out/style.css"
|
||||||
|
|
||||||
|
echo "Generated styles"
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
name = "nvf-manual";
|
name = "nvf-manual";
|
||||||
|
@ -21,7 +42,6 @@ in
|
||||||
|
|
||||||
strictDependencies = true;
|
strictDependencies = true;
|
||||||
nativeBuildInputs = [nixos-render-docs];
|
nativeBuildInputs = [nixos-render-docs];
|
||||||
buildInputs = [dart-sass];
|
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json
|
ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json
|
||||||
|
@ -40,7 +60,7 @@ in
|
||||||
${documentation-highlighter}/loader.js
|
${documentation-highlighter}/loader.js
|
||||||
|
|
||||||
# Copy anchor scripts to the script directory in document root.
|
# Copy anchor scripts to the script directory in document root.
|
||||||
cp -vt $dest/script \
|
cp -vt "$dest"/script \
|
||||||
${./static/script}/anchor-min.js \
|
${./static/script}/anchor-min.js \
|
||||||
${./static/script}/anchor-use.js
|
${./static/script}/anchor-use.js
|
||||||
|
|
||||||
|
@ -53,8 +73,9 @@ in
|
||||||
substituteInPlace ./hacking/additional-plugins.md \
|
substituteInPlace ./hacking/additional-plugins.md \
|
||||||
--subst-var-by NVF_REPO "https://github.com/notashelf/nvf/blob/${manual-release}"
|
--subst-var-by NVF_REPO "https://github.com/notashelf/nvf/blob/${manual-release}"
|
||||||
|
|
||||||
# Compile and copy stylesheet to the project root.
|
# Move compiled stylesheet
|
||||||
sass ${./static/style.css} "$dest/style.css"
|
cp -vt $dest \
|
||||||
|
${compileStylesheet}/style.css
|
||||||
|
|
||||||
# Move release notes
|
# Move release notes
|
||||||
cp -vr ${./release-notes} release-notes
|
cp -vr ${./release-notes} release-notes
|
||||||
|
@ -74,9 +95,9 @@ in
|
||||||
nixos-render-docs manual html \
|
nixos-render-docs manual html \
|
||||||
--manpage-urls ${path + "/doc/manpage-urls.json"} \
|
--manpage-urls ${path + "/doc/manpage-urls.json"} \
|
||||||
--revision ${lib.trivial.revisionWithDefault manual-release} \
|
--revision ${lib.trivial.revisionWithDefault manual-release} \
|
||||||
--stylesheet style.css \
|
--stylesheet "$dest"/style.css \
|
||||||
--script highlightjs/highlight.pack.js \
|
--script ./highlightjs/highlight.pack.js \
|
||||||
--script highlightjs/loader.js \
|
--script ./highlightjs/loader.js \
|
||||||
--script script/anchor-use.js \
|
--script script/anchor-use.js \
|
||||||
--script script/anchor-min.js \
|
--script script/anchor-min.js \
|
||||||
--toc-depth 2 \
|
--toc-depth 2 \
|
||||||
|
|
|
@ -285,6 +285,9 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
- Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary
|
- Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary
|
||||||
spellfiles to Neovim's runtime with ease.
|
spellfiles to Neovim's runtime with ease.
|
||||||
|
|
||||||
|
- Add combined nvf configuration (`config.vim`) into the final package's
|
||||||
|
passthru as `passthru.neovimConfiguration` for easier debugging.
|
||||||
|
|
||||||
[ppenguin](https://github.com/ppenguin):
|
[ppenguin](https://github.com/ppenguin):
|
||||||
|
|
||||||
- Telescope:
|
- Telescope:
|
||||||
|
@ -302,6 +305,9 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
`vim.languages.kotlin`
|
`vim.languages.kotlin`
|
||||||
- changed default keybinds for leap.nvim to avoid altering expected behavior
|
- changed default keybinds for leap.nvim to avoid altering expected behavior
|
||||||
- Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala`
|
- Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala`
|
||||||
|
- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for
|
||||||
|
the Typst language module.
|
||||||
|
- Add LSP and Treesitter support for Assembly under `vim.languages.assembly`
|
||||||
|
|
||||||
[Bloxx12](https://github.com/Bloxx12)
|
[Bloxx12](https://github.com/Bloxx12)
|
||||||
|
|
||||||
|
@ -322,3 +328,7 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
[](#opt-vim.languages.svelte.format.type) respectively.
|
[](#opt-vim.languages.svelte.format.type) respectively.
|
||||||
- Replace [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt) with
|
- Replace [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt) with
|
||||||
[nixfmt](https://github.com/NixOS/nixfmt) (nixfmt-rfc-style).
|
[nixfmt](https://github.com/NixOS/nixfmt) (nixfmt-rfc-style).
|
||||||
|
|
||||||
|
[Nowaaru](https://github.com/Nowaaru):
|
||||||
|
|
||||||
|
- Add `precognition-nvim`.
|
||||||
|
|
7
docs/static/style.css
vendored
Normal file
7
docs/static/style.css
vendored
Normal file
File diff suppressed because one or more lines are too long
4
docs/static/style.scss
vendored
4
docs/static/style.scss
vendored
|
@ -1,3 +1,5 @@
|
||||||
|
@use "scss-reset/reset";
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--nmd-color0: #0a3e68;
|
--nmd-color0: #0a3e68;
|
||||||
--nmd-color1: #268598;
|
--nmd-color1: #268598;
|
||||||
|
@ -32,8 +34,6 @@ $color-blue-700: #1d4ed8;
|
||||||
$color-blue-800: #1e40af;
|
$color-blue-800: #1e40af;
|
||||||
$color-blue-900: #1e3a8a;
|
$color-blue-900: #1e3a8a;
|
||||||
|
|
||||||
@use "scss-reset/reset";
|
|
||||||
|
|
||||||
@mixin boxed {
|
@mixin boxed {
|
||||||
background: $color-gray-50;
|
background: $color-gray-50;
|
||||||
margin: 2rem 16px;
|
margin: 2rem 16px;
|
||||||
|
|
97
docs/static/tomorrow-night.min.css
vendored
97
docs/static/tomorrow-night.min.css
vendored
|
@ -4,99 +4,4 @@
|
||||||
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
License: ~ MIT (or more permissive) [via base16-schemes-source]
|
||||||
Maintainer: @highlightjs/core-team
|
Maintainer: @highlightjs/core-team
|
||||||
Version: 2021.09.0
|
Version: 2021.09.0
|
||||||
*/
|
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#2d2d2d}.hljs ::selection,.hljs::selection{background-color:#515151;color:#ccc}.hljs-comment{color:#999}.hljs-tag{color:#b4b7b4}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2777a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fc6}.hljs-strong{font-weight:700;color:#fc6}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9c9}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6cc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c9c}.hljs-emphasis{color:#c9c;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}
|
||||||
pre code.hljs {
|
|
||||||
display: block;
|
|
||||||
overflow-x: auto;
|
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
code.hljs {
|
|
||||||
padding: 3px 5px;
|
|
||||||
}
|
|
||||||
.hljs {
|
|
||||||
color: #ccc;
|
|
||||||
background: #2d2d2d;
|
|
||||||
}
|
|
||||||
.hljs ::selection,
|
|
||||||
.hljs::selection {
|
|
||||||
background-color: #515151;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
.hljs-comment {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
.hljs-tag {
|
|
||||||
color: #b4b7b4;
|
|
||||||
}
|
|
||||||
.hljs-operator,
|
|
||||||
.hljs-punctuation,
|
|
||||||
.hljs-subst {
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
.hljs-operator {
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
.hljs-bullet,
|
|
||||||
.hljs-deletion,
|
|
||||||
.hljs-name,
|
|
||||||
.hljs-selector-tag,
|
|
||||||
.hljs-template-variable,
|
|
||||||
.hljs-variable {
|
|
||||||
color: #f2777a;
|
|
||||||
}
|
|
||||||
.hljs-attr,
|
|
||||||
.hljs-link,
|
|
||||||
.hljs-literal,
|
|
||||||
.hljs-number,
|
|
||||||
.hljs-symbol,
|
|
||||||
.hljs-variable.constant_ {
|
|
||||||
color: #f99157;
|
|
||||||
}
|
|
||||||
.hljs-class .hljs-title,
|
|
||||||
.hljs-title,
|
|
||||||
.hljs-title.class_ {
|
|
||||||
color: #fc6;
|
|
||||||
}
|
|
||||||
.hljs-strong {
|
|
||||||
font-weight: 700;
|
|
||||||
color: #fc6;
|
|
||||||
}
|
|
||||||
.hljs-addition,
|
|
||||||
.hljs-code,
|
|
||||||
.hljs-string,
|
|
||||||
.hljs-title.class_.inherited__ {
|
|
||||||
color: #9c9;
|
|
||||||
}
|
|
||||||
.hljs-built_in,
|
|
||||||
.hljs-doctag,
|
|
||||||
.hljs-keyword.hljs-atrule,
|
|
||||||
.hljs-quote,
|
|
||||||
.hljs-regexp {
|
|
||||||
color: #6cc;
|
|
||||||
}
|
|
||||||
.hljs-attribute,
|
|
||||||
.hljs-function .hljs-title,
|
|
||||||
.hljs-section,
|
|
||||||
.hljs-title.function_,
|
|
||||||
.ruby .hljs-property {
|
|
||||||
color: #69c;
|
|
||||||
}
|
|
||||||
.diff .hljs-meta,
|
|
||||||
.hljs-keyword,
|
|
||||||
.hljs-template-tag,
|
|
||||||
.hljs-type {
|
|
||||||
color: #c9c;
|
|
||||||
}
|
|
||||||
.hljs-emphasis {
|
|
||||||
color: #c9c;
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
.hljs-meta,
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta .hljs-string {
|
|
||||||
color: #a3685a;
|
|
||||||
}
|
|
||||||
.hljs-meta .hljs-keyword,
|
|
||||||
.hljs-meta-keyword {
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
573
flake.lock
573
flake.lock
File diff suppressed because it is too large
Load diff
|
@ -439,7 +439,7 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-scrollbar-nvim = {
|
plugin-nvim-scrollbar = {
|
||||||
url = "github:petertriho/nvim-scrollbar";
|
url = "github:petertriho/nvim-scrollbar";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
@ -562,6 +562,11 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin-precognition-nvim = {
|
||||||
|
url = "github:tris203/precognition.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# Note-taking
|
# Note-taking
|
||||||
plugin-obsidian-nvim = {
|
plugin-obsidian-nvim = {
|
||||||
url = "github:epwalsh/obsidian.nvim";
|
url = "github:epwalsh/obsidian.nvim";
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
|
||||||
#!${pkgs.stdenv.shell}
|
#!${pkgs.stdenv.shell}
|
||||||
# use xdg-open to open the docs in the browser
|
# use xdg-open to open the docs in the browser
|
||||||
${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html}
|
${pkgs.xdg-utils}/bin/xdg-open ${docs.manual.html}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Exposed neovim configurations
|
# Exposed neovim configurations
|
||||||
|
@ -29,10 +29,10 @@
|
||||||
|
|
||||||
# Published docker images
|
# Published docker images
|
||||||
docker-nix = let
|
docker-nix = let
|
||||||
inherit (pkgs) bash gitFull buildEnv dockerTools;
|
inherit (pkgs) bash gitFull buildEnv;
|
||||||
inherit (config.legacyPackages) neovim-nix;
|
inherit (config.legacyPackages) neovim-nix;
|
||||||
in
|
in
|
||||||
dockerTools.buildImage {
|
pkgs.dockerTools.buildImage {
|
||||||
name = "nvf";
|
name = "nvf";
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,11 @@ in {
|
||||||
paths = [neovim-wrapped printConfig printConfigPath];
|
paths = [neovim-wrapped printConfig printConfigPath];
|
||||||
postBuild = "echo Helpers added";
|
postBuild = "echo Helpers added";
|
||||||
|
|
||||||
|
# Allow evaluating vimOptions, i.e., config.vim from the packages' passthru
|
||||||
|
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
|
||||||
|
# will return the configuration in full.
|
||||||
|
passthru.neovimConfig = vimOptions;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Wrapped version of Neovim with additional helper scripts";
|
description = "Wrapped version of Neovim with additional helper scripts";
|
||||||
mainProgram = "nvim";
|
mainProgram = "nvim";
|
||||||
|
|
|
@ -42,6 +42,20 @@ in {
|
||||||
after = ''
|
after = ''
|
||||||
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
|
${optionalString luasnipEnable "local luasnip = require('luasnip')"}
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
|
|
||||||
|
local kinds = require("cmp.types").lsp.CompletionItemKind
|
||||||
|
local deprio = function(kind)
|
||||||
|
return function(e1, e2)
|
||||||
|
if e1:get_kind() == kind then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
if e2:get_kind() == kind then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
cmp.setup(${toLuaObject cfg.setupOpts})
|
cmp.setup(${toLuaObject cfg.setupOpts})
|
||||||
|
|
||||||
${optionalString config.vim.lazy.enable
|
${optionalString config.vim.lazy.enable
|
||||||
|
|
|
@ -29,6 +29,8 @@ in {
|
||||||
sorting.comparators = mkOption {
|
sorting.comparators = mkOption {
|
||||||
type = mergelessListOf (either str luaInline);
|
type = mergelessListOf (either str luaInline);
|
||||||
default = [
|
default = [
|
||||||
|
(mkLuaInline "deprio(kinds.Text)")
|
||||||
|
(mkLuaInline "deprio(kinds.Snippet)")
|
||||||
"offset"
|
"offset"
|
||||||
"exact"
|
"exact"
|
||||||
"score"
|
"score"
|
||||||
|
@ -43,6 +45,12 @@ in {
|
||||||
(see `:help cmp-config.sorting.comparators`),
|
(see `:help cmp-config.sorting.comparators`),
|
||||||
or a string, in which case the builtin comparator with that name will
|
or a string, in which case the builtin comparator with that name will
|
||||||
be used.
|
be used.
|
||||||
|
|
||||||
|
A `deprio` function and a `kinds`
|
||||||
|
(`require("cmp.types").lsp.CompletionItemKind`) variable is provided
|
||||||
|
above `setupOpts`. By passing a type to the funcion, the returned
|
||||||
|
function will be a comparator that always ranks the specified kind the
|
||||||
|
lowest.
|
||||||
'';
|
'';
|
||||||
apply = map (
|
apply = map (
|
||||||
c:
|
c:
|
||||||
|
|
|
@ -24,7 +24,7 @@ in {
|
||||||
cmd = ["Neotree"];
|
cmd = ["Neotree"];
|
||||||
};
|
};
|
||||||
|
|
||||||
visuals.nvimWebDevicons.enable = true;
|
visuals.nvim-web-devicons.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
49
modules/plugins/languages/asm.nix
Normal file
49
modules/plugins/languages/asm.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.types) package;
|
||||||
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.assembly;
|
||||||
|
in {
|
||||||
|
options.vim.languages.assembly = {
|
||||||
|
enable = mkEnableOption "Assembly support";
|
||||||
|
|
||||||
|
treesitter = {
|
||||||
|
enable = mkEnableOption "Assembly treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
|
package = mkGrammarOption pkgs "asm";
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
enable = mkEnableOption "Assembly LSP support (asm-lsp)" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = package;
|
||||||
|
default = pkgs.asm-lsp;
|
||||||
|
description = "asm-lsp package";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
vim.lsp.lspconfig.sources.asm-lsp = ''
|
||||||
|
lspconfig.asm_lsp.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach,
|
||||||
|
cmd = {"${cfg.lsp.package}/bin/asm-lsp"},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
inherit (lib.nvim.languages) mkEnable;
|
inherit (lib.nvim.languages) mkEnable;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
|
./asm.nix
|
||||||
./bash.nix
|
./bash.nix
|
||||||
./dart.nix
|
./dart.nix
|
||||||
./clang.nix
|
./clang.nix
|
||||||
|
|
|
@ -14,6 +14,38 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.typst;
|
cfg = config.vim.languages.typst;
|
||||||
|
|
||||||
|
defaultServer = "tinymist";
|
||||||
|
servers = {
|
||||||
|
typst-lsp = {
|
||||||
|
package = pkgs.typst-lsp;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.typst_lsp.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach,
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
tinymist = {
|
||||||
|
package = pkgs.tinymist;
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.tinymist.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = default_on_attach,
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${cfg.lsp.package}/bin/tinymist"}''
|
||||||
|
},
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
defaultFormat = "typstfmt";
|
defaultFormat = "typstfmt";
|
||||||
formats = {
|
formats = {
|
||||||
typstfmt = {
|
typstfmt = {
|
||||||
|
@ -52,11 +84,17 @@ in {
|
||||||
lsp = {
|
lsp = {
|
||||||
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
|
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
|
server = mkOption {
|
||||||
|
description = "Typst LSP server to use";
|
||||||
|
type = enum (attrNames servers);
|
||||||
|
default = defaultServer;
|
||||||
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "typst-lsp package, or the command to run as a list of strings";
|
description = "typst-lsp package, or the command to run as a list of strings";
|
||||||
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
|
||||||
type = either package (listOf str);
|
type = either package (listOf str);
|
||||||
default = pkgs.typst-lsp;
|
default = servers.${cfg.lsp.server}.package;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -82,19 +120,14 @@ in {
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.format.enable {
|
||||||
|
vim.lsp.null-ls.enable = true;
|
||||||
|
vim.lsp.null-ls.sources.typst-format = formats.${cfg.format.type}.nullConfig;
|
||||||
|
})
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
vim.lsp.lspconfig.enable = true;
|
vim.lsp.lspconfig.enable = true;
|
||||||
vim.lsp.lspconfig.sources.typst-lsp = ''
|
vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
lspconfig.typst_lsp.setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach=default_on_attach,
|
|
||||||
cmd = ${
|
|
||||||
if isList cfg.lsp.package
|
|
||||||
then expToLua cfg.lsp.package
|
|
||||||
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
|
|
||||||
},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,14 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = [
|
startPlugins = [
|
||||||
(assert config.vim.visuals.nvimWebDevicons.enable; "nvim-bufferline-lua")
|
"nvim-bufferline-lua"
|
||||||
"bufdelete-nvim"
|
"bufdelete-nvim"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Soft-dependency for bufferline.
|
||||||
|
# Recommended by upstream, so enabled here.
|
||||||
|
visuals.nvim-web-devicons.enable = true;
|
||||||
|
|
||||||
maps.normal = mkMerge [
|
maps.normal = mkMerge [
|
||||||
(mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete" mappings.closeCurrent.description)
|
(mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete" mappings.closeCurrent.description)
|
||||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||||
|
|
|
@ -4,33 +4,20 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.strings) optionalString;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.binds.whichKey;
|
cfg = config.vim.binds.whichKey;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim.startPlugins = ["which-key"];
|
vim = {
|
||||||
|
startPlugins = ["which-key"];
|
||||||
|
|
||||||
vim.pluginRC.whichkey = entryAnywhere ''
|
pluginRC.whichkey = entryAnywhere ''
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
wk.setup ({
|
wk.setup (${toLuaObject cfg.setupOpts})
|
||||||
key_labels = {
|
|
||||||
["<space>"] = "SPACE",
|
|
||||||
["<leader>"] = "SPACE",
|
|
||||||
["<cr>"] = "RETURN",
|
|
||||||
["<tab>"] = "TAB",
|
|
||||||
},
|
|
||||||
|
|
||||||
${optionalString config.vim.ui.borders.plugins.which-key.enable ''
|
|
||||||
window = {
|
|
||||||
border = ${toLuaObject config.vim.ui.borders.plugins.which-key.style},
|
|
||||||
},
|
|
||||||
''}
|
|
||||||
})
|
|
||||||
|
|
||||||
wk.register(${toLuaObject cfg.register})
|
wk.register(${toLuaObject cfg.register})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./which-key.nix
|
./which-key.nix
|
||||||
./config.nix
|
./config.nix
|
||||||
|
|
|
@ -1,14 +1,51 @@
|
||||||
{lib, ...}: let
|
{
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
config,
|
||||||
inherit (lib.types) attrsOf nullOr str;
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) attrsOf nullOr str attrs enum bool;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
in {
|
in {
|
||||||
options.vim.binds.whichKey = {
|
options.vim.binds.whichKey = {
|
||||||
enable = mkEnableOption "which-key keybind helper menu";
|
enable = mkEnableOption "which-key keybind helper menu";
|
||||||
|
|
||||||
register = mkOption {
|
register = mkOption {
|
||||||
description = "Register label for which-key keybind helper menu";
|
|
||||||
type = attrsOf (nullOr str);
|
type = attrsOf (nullOr str);
|
||||||
default = {};
|
default = {};
|
||||||
|
description = "Register label for which-key keybind helper menu";
|
||||||
|
};
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "which-key" {
|
||||||
|
preset = mkOption {
|
||||||
|
type = enum ["classic" "modern" "helix"];
|
||||||
|
default = "modern";
|
||||||
|
description = "The default preset for the which-key window";
|
||||||
|
};
|
||||||
|
|
||||||
|
notify = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Show a warning when issues were detected with mappings";
|
||||||
|
};
|
||||||
|
|
||||||
|
replace = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {
|
||||||
|
"<space>" = "SPACE";
|
||||||
|
"<leader>" = "SPACE";
|
||||||
|
"<cr>" = "RETURN";
|
||||||
|
"<tab>" = "TAB";
|
||||||
|
};
|
||||||
|
description = "Functions/Lua Patterns for formatting the labels";
|
||||||
|
};
|
||||||
|
|
||||||
|
win = {
|
||||||
|
border = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = config.vim.ui.borders.plugins.which-key.style;
|
||||||
|
description = "Which-key window border style";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,5 +2,6 @@ _: {
|
||||||
imports = [
|
imports = [
|
||||||
./hop
|
./hop
|
||||||
./leap
|
./leap
|
||||||
|
./precognition
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
18
modules/plugins/utility/motion/precognition/config.nix
Normal file
18
modules/plugins/utility/motion/precognition/config.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
|
||||||
|
cfg = config.vim.utility.motion.precognition;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["precognition-nvim"];
|
||||||
|
luaConfigRC.precognition = lib.nvim.dag.entryAnywhere ''
|
||||||
|
require('precognition').setup(${lib.nvim.lua.toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/utility/motion/precognition/default.nix
Normal file
6
modules/plugins/utility/motion/precognition/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./precognition.nix
|
||||||
|
./config.nix
|
||||||
|
];
|
||||||
|
}
|
66
modules/plugins/utility/motion/precognition/precognition.nix
Normal file
66
modules/plugins/utility/motion/precognition/precognition.nix
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
|
inherit (lib.types) attrsOf listOf str bool int submodule;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
|
||||||
|
mkHintType = description:
|
||||||
|
mkOption {
|
||||||
|
inherit description;
|
||||||
|
default = {};
|
||||||
|
type = attrsOf (submodule {
|
||||||
|
options = {
|
||||||
|
text = mkOption {
|
||||||
|
type = str;
|
||||||
|
description = "The easier-to-read depiction of the motion";
|
||||||
|
};
|
||||||
|
|
||||||
|
prio = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 1;
|
||||||
|
description = "The priority of the hint";
|
||||||
|
example = 10;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.utility.motion.precognition = {
|
||||||
|
enable = mkEnableOption "assisted motion discovery[precognition.nvim]";
|
||||||
|
setupOpts = mkPluginSetupOption "precognition.nvim" {
|
||||||
|
startVisible = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to start 'precognition' automatically";
|
||||||
|
};
|
||||||
|
|
||||||
|
showBlankVirtLine = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to show a blank virtual line when no movements are shown";
|
||||||
|
};
|
||||||
|
|
||||||
|
highlightColor = mkOption {
|
||||||
|
type = attrsOf str;
|
||||||
|
default = {link = "Comment";};
|
||||||
|
example = literalExpression ''
|
||||||
|
{ link = "Comment"; }
|
||||||
|
# or
|
||||||
|
{ foreground = "#0000FF"; background = "#000000"; };
|
||||||
|
'';
|
||||||
|
description = "The highlight for the virtual text";
|
||||||
|
};
|
||||||
|
|
||||||
|
disabled_fts = mkOption {
|
||||||
|
type = listOf str;
|
||||||
|
default = ["startify"];
|
||||||
|
example = literalExpression ''["startify"]'';
|
||||||
|
description = "Filetypes that automatically disable 'precognition'";
|
||||||
|
};
|
||||||
|
|
||||||
|
hints = mkHintType "What motions display, and at what priority";
|
||||||
|
gutterHints = mkHintType ''
|
||||||
|
What motions display and at what priority. Only appears in gutters
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.nvim.types) luaInline;
|
||||||
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule ["vim" "visuals" "cellularAutomaton"] ["vim" "visuals" "cellular-automaton"])
|
||||||
|
];
|
||||||
|
|
||||||
|
options.vim.visuals.cellular-automaton = {
|
||||||
|
enable = mkEnableOption "cellular-automaton to help you cope with stubborn code [cellular-automaton]";
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
makeItRain = mkMappingOption "Make it rain [cellular-automaton]" "<leader>fml";
|
||||||
|
};
|
||||||
|
|
||||||
|
animation = {
|
||||||
|
register = mkEnableOption "registering configured animation(s) automatically" // {default = true;};
|
||||||
|
setup = mkOption {
|
||||||
|
type = luaInline;
|
||||||
|
default = mkLuaInline ''
|
||||||
|
local ca_config = {
|
||||||
|
fps = 50,
|
||||||
|
name = 'slide',
|
||||||
|
}
|
||||||
|
|
||||||
|
-- init function is invoked only once at the start
|
||||||
|
-- config.init = function (grid)
|
||||||
|
--
|
||||||
|
-- end
|
||||||
|
|
||||||
|
-- update function
|
||||||
|
ca_config.update = function (grid)
|
||||||
|
for i = 1, #grid do
|
||||||
|
local prev = grid[i][#(grid[i])]
|
||||||
|
for j = 1, #(grid[i]) do
|
||||||
|
grid[i][j], prev = prev, grid[i][j]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Configuration used to generate an animation to be registered.
|
||||||
|
|
||||||
|
The final value for `ca_config` will be used to register a new
|
||||||
|
animation using `require("cellular-automaton").register_animation(ca_config)`
|
||||||
|
|
||||||
|
::: {.warning}
|
||||||
|
`ca_config` **must** eval to a valid Lua table. nvf does not and cannot
|
||||||
|
perform any kind of validation on your Lua code, so bogus values will
|
||||||
|
result in errors when the animation is registered.
|
||||||
|
:::
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
39
modules/plugins/visuals/cellular-automaton/config.nix
Normal file
39
modules/plugins/visuals/cellular-automaton/config.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.strings) optionalString;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere entryAfter;
|
||||||
|
inherit (lib.nvim.binds) mkBinding;
|
||||||
|
|
||||||
|
cfg = config.vim.visuals.cellular-automaton;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["cellular-automaton"];
|
||||||
|
|
||||||
|
maps.normal = mkBinding cfg.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" "Make it rain";
|
||||||
|
|
||||||
|
pluginRC = {
|
||||||
|
# XXX: This has no error handling. User can set
|
||||||
|
# `animation.setup` to a bogus value, and we would
|
||||||
|
# have an error in our hands. I don't think there
|
||||||
|
# is a good way to check for errors, so I'm leaving
|
||||||
|
# it like this under the assumption that the user
|
||||||
|
# will not mess it up for no reason.
|
||||||
|
cellular-automaton-anim = entryAnywhere (optionalString cfg.animation.register ''
|
||||||
|
-- Coerce user animation config into pluginRC
|
||||||
|
${toLuaObject cfg.animation.setup}
|
||||||
|
'');
|
||||||
|
|
||||||
|
cellular-automaton = entryAfter ["cellular-automaton-anim"] ''
|
||||||
|
-- Register the animation
|
||||||
|
require("cellular-automaton").register_animation(ca_config)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/visuals/cellular-automaton/default.nix
Normal file
6
modules/plugins/visuals/cellular-automaton/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./cellular-automaton.nix
|
||||||
|
];
|
||||||
|
}
|
35
modules/plugins/visuals/cinnamon-nvim/cinnamon-nvim.nix
Normal file
35
modules/plugins/visuals/cinnamon-nvim/cinnamon-nvim.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.modules) mkRemovedOptionModule;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) submodule attrs attrsOf;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRemovedOptionModule ["vim" "visuals" "smoothScroll"] ''
|
||||||
|
`vim.visuals.smoothScroll` has been removed. You may consider enabling the
|
||||||
|
option `vim.visuals.cinnamon-nvim` to repliace previous smooth scrolling
|
||||||
|
behaviour.
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
|
options.vim.visuals.cinnamon-nvim = {
|
||||||
|
enable = mkEnableOption "smooth scrolling for ANY command [cinnamon-nvim]";
|
||||||
|
setupOpts = mkPluginSetupOption "cinnamon.nvim" {
|
||||||
|
options = mkOption {
|
||||||
|
type = attrs;
|
||||||
|
default = {
|
||||||
|
# Defaults provided for the sake of documentation only!
|
||||||
|
# Who would've guessed setupOpts.options would be confusing?
|
||||||
|
mode = "cursor";
|
||||||
|
count_only = false;
|
||||||
|
};
|
||||||
|
description = "Scroll options";
|
||||||
|
};
|
||||||
|
|
||||||
|
keymaps = {
|
||||||
|
basic = mkEnableOption "basic animation keymaps";
|
||||||
|
extra = mkEnableOption "extra animation keymaps";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
modules/plugins/visuals/cinnamon-nvim/config.nix
Normal file
21
modules/plugins/visuals/cinnamon-nvim/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.visuals.cinnamon-nvim;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["cinnamon-nvim"];
|
||||||
|
|
||||||
|
pluginRC.cursorline = entryAnywhere ''
|
||||||
|
require("cinnamon").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/visuals/cinnamon-nvim/default.nix
Normal file
6
modules/plugins/visuals/cinnamon-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./cinnamon-nvim.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,118 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.trivial) boolToString;
|
|
||||||
inherit (lib.nvim.binds) mkBinding;
|
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.visuals;
|
|
||||||
in {
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
|
||||||
(mkIf cfg.indentBlankline.enable {
|
|
||||||
vim.startPlugins = ["indent-blankline"];
|
|
||||||
vim.pluginRC.indent-blankline = entryAnywhere ''
|
|
||||||
require("ibl").setup(${toLuaObject cfg.indentBlankline.setupOpts})
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.cursorline.enable {
|
|
||||||
vim.startPlugins = ["nvim-cursorline"];
|
|
||||||
vim.pluginRC.cursorline = entryAnywhere ''
|
|
||||||
require('nvim-cursorline').setup {
|
|
||||||
cursorline = {
|
|
||||||
timeout = ${toString cfg.cursorline.lineTimeout},
|
|
||||||
number = ${boolToString (!cfg.cursorline.lineNumbersOnly)},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.nvimWebDevicons.enable {
|
|
||||||
vim.startPlugins = ["nvim-web-devicons"];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.scrollBar.enable {
|
|
||||||
vim.startPlugins = ["scrollbar-nvim"];
|
|
||||||
vim.pluginRC.scrollBar = entryAnywhere ''
|
|
||||||
require('scrollbar').setup{
|
|
||||||
excluded_filetypes = {
|
|
||||||
'prompt',
|
|
||||||
'TelescopePrompt',
|
|
||||||
'noice',
|
|
||||||
'NvimTree',
|
|
||||||
'alpha',
|
|
||||||
'notify',
|
|
||||||
'Navbuddy'
|
|
||||||
},
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.smoothScroll.enable {
|
|
||||||
vim.startPlugins = ["cinnamon-nvim"];
|
|
||||||
vim.pluginRC.smoothScroll = entryAnywhere ''
|
|
||||||
require('cinnamon').setup()
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.cellularAutomaton.enable {
|
|
||||||
vim.startPlugins = ["cellular-automaton"];
|
|
||||||
|
|
||||||
vim.maps.normal = mkBinding cfg.cellularAutomaton.mappings.makeItRain "<cmd>CellularAutomaton make_it_rain<CR>" "Make it rain";
|
|
||||||
|
|
||||||
vim.pluginRC.cellularAUtomaton = entryAnywhere ''
|
|
||||||
local config = {
|
|
||||||
fps = 50,
|
|
||||||
name = 'slide',
|
|
||||||
}
|
|
||||||
|
|
||||||
-- init function is invoked only once at the start
|
|
||||||
-- config.init = function (grid)
|
|
||||||
--
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- update function
|
|
||||||
config.update = function (grid)
|
|
||||||
for i = 1, #grid do
|
|
||||||
local prev = grid[i][#(grid[i])]
|
|
||||||
for j = 1, #(grid[i]) do
|
|
||||||
grid[i][j], prev = prev, grid[i][j]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
require("cellular-automaton").register_animation(config)
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.highlight-undo.enable {
|
|
||||||
vim.startPlugins = ["highlight-undo"];
|
|
||||||
vim.pluginRC.highlight-undo = entryAnywhere ''
|
|
||||||
require('highlight-undo').setup({
|
|
||||||
duration = ${toString cfg.highlight-undo.duration},
|
|
||||||
highlight_for_count = ${boolToString cfg.highlight-undo.highlightForCount},
|
|
||||||
undo = {
|
|
||||||
hlgroup = ${cfg.highlight-undo.undo.hlGroup},
|
|
||||||
mode = 'n',
|
|
||||||
lhs = 'u',
|
|
||||||
map = 'undo',
|
|
||||||
opts = {}
|
|
||||||
},
|
|
||||||
|
|
||||||
redo = {
|
|
||||||
hlgroup = ${cfg.highlight-undo.redo.hlGroup},
|
|
||||||
mode = 'n',
|
|
||||||
lhs = '<C-r>',
|
|
||||||
map = 'redo',
|
|
||||||
opts = {}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
}
|
|
|
@ -1,7 +1,19 @@
|
||||||
{...}: {
|
{lib, ...}: let
|
||||||
|
inherit (lib.modules) mkRemovedOptionModule;
|
||||||
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
./config.nix
|
(mkRemovedOptionModule ["vim" "visuals" "enable"] ''
|
||||||
./visuals.nix
|
As top-level toggles are being deprecated, you are encouraged to handle plugin
|
||||||
./fidget
|
toggles under individual options.
|
||||||
|
'')
|
||||||
|
|
||||||
|
./cellular-automaton
|
||||||
|
./cinnamon-nvim
|
||||||
|
./fidget-nvim
|
||||||
|
./highlight-undo
|
||||||
|
./indent-blankline
|
||||||
|
./nvim-cursorline
|
||||||
|
./nvim-scrollbar
|
||||||
|
./nvim-web-devicons
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,11 @@
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
(mkRenamedOptionModule ["vim" "visuals" "fidget-nvim" "align" "bottom"] ["vim" "visuals" "fidget-nvim" "setupOpts" "notification" "window" "align"])
|
(mkRenamedOptionModule ["vim" "visuals" "fidget-nvim" "align" "bottom"] ["vim" "visuals" "fidget-nvim" "setupOpts" "notification" "window" "align"])
|
||||||
(mkRemovedOptionModule ["vim" "visuals" "fidget-nvim" "align" "right"]
|
(mkRemovedOptionModule ["vim" "visuals" "fidget-nvim" "align" "right"] ''
|
||||||
"Option `vim.fidget-nvim.align.right` has been removed and does not have an equivalent replacement in rewritten fidget.nvim configuration.")
|
Option `vim.fidget-nvim.align.right` has been removed and does not have an
|
||||||
|
equivalent replacement in rewritten fidget.nvim configuration. Please remove
|
||||||
|
it from your configuration.
|
||||||
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
options.vim.visuals.fidget-nvim = {
|
options.vim.visuals.fidget-nvim = {
|
21
modules/plugins/visuals/highlight-undo/config.nix
Normal file
21
modules/plugins/visuals/highlight-undo/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.visuals.highlight-undo;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["highlight-undo"];
|
||||||
|
|
||||||
|
pluginRC.highlight-undo = entryAnywhere ''
|
||||||
|
require("highlight-undo").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/visuals/highlight-undo/default.nix
Normal file
6
modules/plugins/visuals/highlight-undo/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./highlight-undo.nix
|
||||||
|
];
|
||||||
|
}
|
32
modules/plugins/visuals/highlight-undo/highlight-undo.nix
Normal file
32
modules/plugins/visuals/highlight-undo/highlight-undo.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.modules) mkRemovedOptionModule;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) int;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
|
||||||
|
checkDocsMsg = ''
|
||||||
|
highlight-undo.nvim has deprecated previously used configuration options in
|
||||||
|
a recent update, so previous values will no longer work as expected.
|
||||||
|
|
||||||
|
Please use `vim.visuals.highlight-undo.setupOpts` with upstream instructions
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
# This gives a lot of error messages for those with default values set or modified. Could
|
||||||
|
# there be a better way to handle his? Perhaps an assertion?
|
||||||
|
(mkRemovedOptionModule ["vim" "visuals" "highlight-undo" "highlightForCount"] checkDocsMsg)
|
||||||
|
(mkRemovedOptionModule ["vim" "visuals" "highlight-undo" "undo" "hlGroup"] checkDocsMsg)
|
||||||
|
(mkRemovedOptionModule ["vim" "visuals" "highlight-undo" "redo" "hlGroup"] checkDocsMsg)
|
||||||
|
];
|
||||||
|
|
||||||
|
options.vim.visuals.highlight-undo = {
|
||||||
|
enable = mkEnableOption "highlight undo [highlight-undo]";
|
||||||
|
setupOpts = mkPluginSetupOption "highlight-undo" {
|
||||||
|
duration = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 500;
|
||||||
|
description = "Duration of the highlight";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
modules/plugins/visuals/indent-blankline/config.nix
Normal file
21
modules/plugins/visuals/indent-blankline/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.visuals.indent-blankline;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["indent-blankline"];
|
||||||
|
|
||||||
|
pluginRC.indent-blankline = entryAnywhere ''
|
||||||
|
require("ibl").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/visuals/indent-blankline/default.nix
Normal file
6
modules/plugins/visuals/indent-blankline/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./indent-blankline.nix
|
||||||
|
];
|
||||||
|
}
|
195
modules/plugins/visuals/indent-blankline/indent-blankline.nix
Normal file
195
modules/plugins/visuals/indent-blankline/indent-blankline.nix
Normal file
|
@ -0,0 +1,195 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
|
inherit (lib.types) int bool str nullOr either listOf attrsOf;
|
||||||
|
|
||||||
|
cfg = config.vim.visuals;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule ["vim" "visuals" "indentBlankline"] ["vim" "visuals" "indent-blankline"])
|
||||||
|
];
|
||||||
|
|
||||||
|
options.vim.visuals.indent-blankline = {
|
||||||
|
enable = mkEnableOption "indentation guides [indent-blankline]";
|
||||||
|
setupOpts = {
|
||||||
|
debounce = mkOption {
|
||||||
|
type = int;
|
||||||
|
description = "Debounce time in milliseconds";
|
||||||
|
default = 200;
|
||||||
|
};
|
||||||
|
|
||||||
|
viewport_buffer = {
|
||||||
|
min = mkOption {
|
||||||
|
type = int;
|
||||||
|
description = "Number of lines above and below of what is currently
|
||||||
|
visible in the window";
|
||||||
|
default = 30;
|
||||||
|
};
|
||||||
|
|
||||||
|
max = mkOption {
|
||||||
|
type = int;
|
||||||
|
description = "Number of lines above and below of what is currently
|
||||||
|
visible in the window";
|
||||||
|
default = 500;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
indent = {
|
||||||
|
char = mkOption {
|
||||||
|
type = either str (listOf str);
|
||||||
|
description = "Character(s) for indentation guide";
|
||||||
|
default = "│";
|
||||||
|
};
|
||||||
|
|
||||||
|
tab_char = mkOption {
|
||||||
|
type = nullOr (either str (listOf str));
|
||||||
|
description = ''
|
||||||
|
Character(s) for tab indentation guide.
|
||||||
|
|
||||||
|
See `:help ibl.config.indent.tab_char`.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
highlight = mkOption {
|
||||||
|
type = nullOr (either str (listOf str));
|
||||||
|
description = ''
|
||||||
|
The highlight group(s) applied to the indentation guide.
|
||||||
|
|
||||||
|
See `:help ibl.config.indent.highlight`.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
smart_indent_cap = mkOption {
|
||||||
|
type = bool;
|
||||||
|
description = "Caps the number of indentation levels based on surrounding code";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
priority = mkOption {
|
||||||
|
type = int;
|
||||||
|
description = "Virtual text priority for the indentation guide";
|
||||||
|
default = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
repeat_linebreak = mkOption {
|
||||||
|
type = bool;
|
||||||
|
description = "Repeat indentation guides on wrapped lines";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
whitespace = {
|
||||||
|
highlight = mkOption {
|
||||||
|
type = nullOr (either str (listOf str));
|
||||||
|
description = ''
|
||||||
|
The highlight group(s) applied to whitespace.
|
||||||
|
|
||||||
|
See `:help ibl.config.whitespace.highlight`.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
remove_blankline_trail = mkOption {
|
||||||
|
type = bool;
|
||||||
|
description = "Remove trailing whitespace on blanklines";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
scope = {
|
||||||
|
enabled = mkOption {
|
||||||
|
description = "Highlight current scope from treesitter";
|
||||||
|
type = bool;
|
||||||
|
default = config.vim.treesitter.enable;
|
||||||
|
defaultText = literalExpression "config.vim.treesitter.enable";
|
||||||
|
};
|
||||||
|
|
||||||
|
char = mkOption {
|
||||||
|
type = either str (listOf str);
|
||||||
|
description = "The character(s) for the scope indentation guide";
|
||||||
|
default = cfg.indent-blankline.setupOpts.indent.char;
|
||||||
|
defaultText = literalExpression "config.vim.visuals.indent-blankline.setupOpts.indent.char";
|
||||||
|
};
|
||||||
|
|
||||||
|
show_start = mkOption {
|
||||||
|
type = bool;
|
||||||
|
description = "Show an underline on the first line of the scope";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
show_end = mkOption {
|
||||||
|
type = bool;
|
||||||
|
description = "Show an underline on the last line of the scope";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
show_exact_scope = mkOption {
|
||||||
|
type = bool;
|
||||||
|
description = "Show the scope underline at the exact start of the scope, even if that's to the right of the indentation guide";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
injected_languages = mkOption {
|
||||||
|
type = bool;
|
||||||
|
description = "Check for injected languages (treesitter)";
|
||||||
|
default = config.vim.treesitter.enable;
|
||||||
|
defaultText = literalExpression "config.vim.treesitter.enable";
|
||||||
|
};
|
||||||
|
|
||||||
|
highlight = mkOption {
|
||||||
|
type = nullOr (either str (listOf str));
|
||||||
|
description = ''
|
||||||
|
The highlight group(s) applied to the scope.
|
||||||
|
|
||||||
|
See `:help `ibl.config.scope.highlight`.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
priority = mkOption {
|
||||||
|
type = int;
|
||||||
|
description = "Virtual text priority for the scope";
|
||||||
|
default = 1024;
|
||||||
|
};
|
||||||
|
|
||||||
|
include.node_type = mkOption {
|
||||||
|
type = attrsOf (listOf str);
|
||||||
|
description = "Additional nodes to be used for scope checking, per language";
|
||||||
|
default = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
exclude = {
|
||||||
|
language = mkOption {
|
||||||
|
type = listOf str;
|
||||||
|
description = ''
|
||||||
|
The list of treesitter languages to disable scope for.
|
||||||
|
|
||||||
|
`*` can be used as a wildcard for every language/node type.
|
||||||
|
'';
|
||||||
|
default = [];
|
||||||
|
};
|
||||||
|
|
||||||
|
node_type = mkOption {
|
||||||
|
type = attrsOf (listOf str);
|
||||||
|
description = ''
|
||||||
|
Nodes to ignore in scope checking, per language.
|
||||||
|
|
||||||
|
`*` can be used as a wildcard for every language.
|
||||||
|
'';
|
||||||
|
default = {
|
||||||
|
"*" = ["source_file" "program"];
|
||||||
|
lua = ["chunk"];
|
||||||
|
python = ["module"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
modules/plugins/visuals/nvim-cursorline/config.nix
Normal file
21
modules/plugins/visuals/nvim-cursorline/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.visuals.nvim-cursorline;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["nvim-cursorline"];
|
||||||
|
|
||||||
|
pluginRC.nvim-cursorline = entryAnywhere ''
|
||||||
|
require("nvim-cursorline").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/visuals/nvim-cursorline/default.nix
Normal file
6
modules/plugins/visuals/nvim-cursorline/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./nvim-cursorline.nix
|
||||||
|
];
|
||||||
|
}
|
65
modules/plugins/visuals/nvim-cursorline/nvim-cursorline.nix
Normal file
65
modules/plugins/visuals/nvim-cursorline/nvim-cursorline.nix
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.modules) mkRenamedOptionModule mkRemovedOptionModule;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) int bool;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule ["vim" "visuals" "cursorline"] ["vim" "visuals" "nvim-cursorline"])
|
||||||
|
(mkRenamedOptionModule ["vim" "visuals" "nvim-cursorline" "lineTimeout"] ["vim" "visuals" "nvim-cursorline" "setupOpts" "line_timeout"])
|
||||||
|
(mkRemovedOptionModule ["vim" "visuals" "nvim-cursorline" "lineNumbersOnly"] ''
|
||||||
|
`vim.visuals.nvim-cursorline.lineNumbersOnly` has been removed. Use `vim.visuals.nvim-cursorline.number` instead.
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
|
options.vim.visuals.nvim-cursorline = {
|
||||||
|
enable = mkEnableOption "cursor word and line highlighting [nvim-cursorline]";
|
||||||
|
|
||||||
|
# Upstream has **zero** documentation whatsoever. I'm making wild assumptions
|
||||||
|
# on what goes into description based don the source code. I'm sorry. Not.
|
||||||
|
setupOpts = mkPluginSetupOption "nvim-cursorline" {
|
||||||
|
cursorline = {
|
||||||
|
enable = mkEnableOption "cursor line highlighting";
|
||||||
|
timeout = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 1000;
|
||||||
|
description = "Cursorline timeout";
|
||||||
|
};
|
||||||
|
|
||||||
|
number = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
If true, `vim.wo.cursorlineopt` will be set to "number"
|
||||||
|
when the trigger conditions are met.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
cursorword = {
|
||||||
|
enable = mkEnableOption "cursor word highlighting";
|
||||||
|
timeout = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 1000;
|
||||||
|
description = "Cursorword timeout";
|
||||||
|
};
|
||||||
|
|
||||||
|
min_length = mkOption {
|
||||||
|
type = int;
|
||||||
|
default = 3;
|
||||||
|
description = ''
|
||||||
|
The min_length option defines the minimum number of characters
|
||||||
|
a word must have to be highlighted as a "cursor word." Any word
|
||||||
|
shorter than this value will be ignored and not highlighted.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
hl.underline = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
description = "Whether to underline matching cursorword";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
modules/plugins/visuals/nvim-scrollbar/config.nix
Normal file
21
modules/plugins/visuals/nvim-scrollbar/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.visuals.nvim-scrollbar;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["nvim-scrollbar"];
|
||||||
|
|
||||||
|
pluginRC.cursorline = entryAnywhere ''
|
||||||
|
require("scrollbar").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/visuals/nvim-scrollbar/default.nix
Normal file
6
modules/plugins/visuals/nvim-scrollbar/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./scrollbar-nvim.nix
|
||||||
|
];
|
||||||
|
}
|
21
modules/plugins/visuals/nvim-scrollbar/scrollbar-nvim.nix
Normal file
21
modules/plugins/visuals/nvim-scrollbar/scrollbar-nvim.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) listOf str;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule ["vim" "visuals" "scrollBar"] ["vim" "visuals" "nvim-scrollbar"])
|
||||||
|
];
|
||||||
|
|
||||||
|
options.vim.visuals.nvim-scrollbar = {
|
||||||
|
enable = mkEnableOption "extensible Neovim Scrollbar [nvim-scrollbar]";
|
||||||
|
setupOpts = mkPluginSetupOption "scrollbar-nvim" {
|
||||||
|
excluded_filetypes = mkOption {
|
||||||
|
type = listOf str;
|
||||||
|
default = ["prompt" "TelescopePrompt" "noice" "noice" "NvimTree" "neo-tree" "alpha" "notify" "Navbuddy"];
|
||||||
|
description = "Filetypes to hide the scrollbar on";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
modules/plugins/visuals/nvim-web-devicons/config.nix
Normal file
21
modules/plugins/visuals/nvim-web-devicons/config.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
|
cfg = config.vim.visuals.nvim-web-devicons;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = ["nvim-web-devicons"];
|
||||||
|
|
||||||
|
pluginRC.nvim-web-devicons = entryAnywhere ''
|
||||||
|
require("nvim-web-devicons").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/visuals/nvim-web-devicons/default.nix
Normal file
6
modules/plugins/visuals/nvim-web-devicons/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./nvim-web-devicons.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkRenamedOptionModule;
|
||||||
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||||
|
inherit (lib.types) nullOr attrsOf attrs enum;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule ["vim" "visuals" "nvimWebDevicons"] ["vim" "visuals" "nvim-web-devicons"])
|
||||||
|
];
|
||||||
|
|
||||||
|
options.vim.visuals.nvim-web-devicons = {
|
||||||
|
enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]";
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "nvim-web-devicons" {
|
||||||
|
color_icons = mkEnableOption "different highlight colors per icon" // {default = true;};
|
||||||
|
variant = mkOption {
|
||||||
|
type = nullOr (enum ["light" "dark"]);
|
||||||
|
default = null;
|
||||||
|
description = "Set the light or dark variant manually, instead of relying on `background`";
|
||||||
|
};
|
||||||
|
|
||||||
|
override = mkOption {
|
||||||
|
type = attrsOf attrs;
|
||||||
|
default = {};
|
||||||
|
example = literalExpression ''
|
||||||
|
{
|
||||||
|
zsh = {
|
||||||
|
name = "Zsh";
|
||||||
|
icon = "";
|
||||||
|
color = "#428850";
|
||||||
|
cterm_color = "65";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Your personal icon overrides.
|
||||||
|
|
||||||
|
You can specify color or cterm_color instead of specifying
|
||||||
|
both of them. DevIcon will be appended to `name`
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,261 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
|
||||||
inherit (lib.types) int bool str nullOr either listOf attrsOf;
|
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
|
||||||
|
|
||||||
cfg = config.vim.visuals;
|
|
||||||
in {
|
|
||||||
options.vim.visuals = {
|
|
||||||
enable = mkEnableOption "Visual enhancements.";
|
|
||||||
|
|
||||||
nvimWebDevicons.enable = mkEnableOption "dev icons. Required for certain plugins [nvim-web-devicons].";
|
|
||||||
|
|
||||||
scrollBar.enable = mkEnableOption "scrollbar [scrollbar.nvim]";
|
|
||||||
|
|
||||||
smoothScroll.enable = mkEnableOption "smooth scrolling [cinnamon-nvim]";
|
|
||||||
|
|
||||||
cellularAutomaton = {
|
|
||||||
enable = mkEnableOption "cellular automaton [cellular-automaton]";
|
|
||||||
|
|
||||||
mappings = {
|
|
||||||
makeItRain = mkMappingOption "Make it rain [cellular-automaton]" "<leader>fml";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
cursorline = {
|
|
||||||
enable = mkEnableOption "line hightlighting on the cursor [nvim-cursorline]";
|
|
||||||
|
|
||||||
lineTimeout = mkOption {
|
|
||||||
type = int;
|
|
||||||
description = "Time in milliseconds for cursorline to appear";
|
|
||||||
default = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
lineNumbersOnly = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = "Hightlight only in the presence of line numbers";
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
indentBlankline = {
|
|
||||||
enable = mkEnableOption "indentation guides [indent-blankline]";
|
|
||||||
|
|
||||||
setupOpts = {
|
|
||||||
debounce = mkOption {
|
|
||||||
type = int;
|
|
||||||
description = "Debounce time in milliseconds";
|
|
||||||
default = 200;
|
|
||||||
};
|
|
||||||
|
|
||||||
viewport_buffer = {
|
|
||||||
min = mkOption {
|
|
||||||
type = int;
|
|
||||||
description = "Number of lines above and below of what is currently
|
|
||||||
visible in the window";
|
|
||||||
default = 30;
|
|
||||||
};
|
|
||||||
|
|
||||||
max = mkOption {
|
|
||||||
type = int;
|
|
||||||
description = "Number of lines above and below of what is currently
|
|
||||||
visible in the window";
|
|
||||||
default = 500;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
indent = {
|
|
||||||
char = mkOption {
|
|
||||||
type = either str (listOf str);
|
|
||||||
description = "Character(s) for indentation guide";
|
|
||||||
default = "│";
|
|
||||||
};
|
|
||||||
|
|
||||||
tab_char = mkOption {
|
|
||||||
type = nullOr (either str (listOf str));
|
|
||||||
description = ''
|
|
||||||
Character(s) for tab indentation guide.
|
|
||||||
|
|
||||||
See `:help ibl.config.indent.tab_char`.
|
|
||||||
'';
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
highlight = mkOption {
|
|
||||||
type = nullOr (either str (listOf str));
|
|
||||||
description = ''
|
|
||||||
The highlight group(s) applied to the indentation guide.
|
|
||||||
|
|
||||||
See `:help ibl.config.indent.highlight`.
|
|
||||||
'';
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
smart_indent_cap = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = "Caps the number of indentation levels based on surrounding code";
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
priority = mkOption {
|
|
||||||
type = int;
|
|
||||||
description = "Virtual text priority for the indentation guide";
|
|
||||||
default = 1;
|
|
||||||
};
|
|
||||||
|
|
||||||
repeat_linebreak = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = "Repeat indentation guides on wrapped lines";
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
whitespace = {
|
|
||||||
highlight = mkOption {
|
|
||||||
type = nullOr (either str (listOf str));
|
|
||||||
description = ''
|
|
||||||
The highlight group(s) applied to whitespace.
|
|
||||||
|
|
||||||
See `:help ibl.config.whitespace.highlight`.
|
|
||||||
'';
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
remove_blankline_trail = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = "Remove trailing whitespace on blanklines";
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
scope = {
|
|
||||||
enabled = mkOption {
|
|
||||||
description = "Highlight current scope from treesitter";
|
|
||||||
type = bool;
|
|
||||||
default = config.vim.treesitter.enable;
|
|
||||||
defaultText = literalExpression "config.vim.treesitter.enable";
|
|
||||||
};
|
|
||||||
|
|
||||||
char = mkOption {
|
|
||||||
type = either str (listOf str);
|
|
||||||
description = "The character(s) for the scope indentation guide";
|
|
||||||
default = cfg.indentBlankline.setupOpts.indent.char;
|
|
||||||
defaultText = literalExpression "config.vim.visuals.indentBlankline.setuopOpts.indent.char";
|
|
||||||
};
|
|
||||||
|
|
||||||
show_start = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = "Show an underline on the first line of the scope";
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
show_end = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = "Show an underline on the last line of the scope";
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
show_exact_scope = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = "Show the scope underline at the exact start of the scope, even if that's to the right of the indentation guide";
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
injected_languages = mkOption {
|
|
||||||
type = bool;
|
|
||||||
description = "Check for injected languages (treesitter)";
|
|
||||||
default = config.vim.treesitter.enable;
|
|
||||||
defaultText = literalExpression "config.vim.treesitter.enable";
|
|
||||||
};
|
|
||||||
|
|
||||||
highlight = mkOption {
|
|
||||||
type = nullOr (either str (listOf str));
|
|
||||||
description = ''
|
|
||||||
The highlight group(s) applied to the scope.
|
|
||||||
|
|
||||||
See `:help `ibl.config.scope.highlight`.
|
|
||||||
'';
|
|
||||||
default = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
priority = mkOption {
|
|
||||||
type = int;
|
|
||||||
description = "Virtual text priority for the scope";
|
|
||||||
default = 1024;
|
|
||||||
};
|
|
||||||
|
|
||||||
include.node_type = mkOption {
|
|
||||||
type = attrsOf (listOf str);
|
|
||||||
description = "Additional nodes to be used for scope checking, per language";
|
|
||||||
default = {};
|
|
||||||
};
|
|
||||||
|
|
||||||
exclude = {
|
|
||||||
language = mkOption {
|
|
||||||
type = listOf str;
|
|
||||||
description = ''
|
|
||||||
The list of treesitter languages to disable scope for.
|
|
||||||
|
|
||||||
`*` can be used as a wildcard for every language/node type.
|
|
||||||
'';
|
|
||||||
default = [];
|
|
||||||
};
|
|
||||||
|
|
||||||
node_type = mkOption {
|
|
||||||
type = attrsOf (listOf str);
|
|
||||||
description = ''
|
|
||||||
Nodes to ignore in scope checking, per language.
|
|
||||||
|
|
||||||
`*` can be used as a wildcard for every language.
|
|
||||||
'';
|
|
||||||
default = {
|
|
||||||
"*" = ["source_file" "program"];
|
|
||||||
lua = ["chunk"];
|
|
||||||
python = ["module"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
highlight-undo = {
|
|
||||||
enable = mkEnableOption "highlight undo [highlight-undo]";
|
|
||||||
|
|
||||||
highlightForCount = mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = true;
|
|
||||||
description = ''
|
|
||||||
Enable support for highlighting when a <count> is provided before the key
|
|
||||||
If set to false it will only highlight when the mapping is not prefixed with a <count>
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
duration = mkOption {
|
|
||||||
type = int;
|
|
||||||
description = "Duration of highlight";
|
|
||||||
default = 500;
|
|
||||||
};
|
|
||||||
|
|
||||||
undo = {
|
|
||||||
hlGroup = mkOption {
|
|
||||||
type = str;
|
|
||||||
description = "Highlight group for undo";
|
|
||||||
default = "HighlightUndo";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
redo = {
|
|
||||||
hlGroup = mkOption {
|
|
||||||
type = str;
|
|
||||||
description = "Highlight group for redo";
|
|
||||||
default = "HighlightUndo";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -189,7 +189,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
plugins = mkOption {
|
plugins = mkOption {
|
||||||
default = [];
|
default = {};
|
||||||
type = attrsOf lznPluginType;
|
type = attrsOf lznPluginType;
|
||||||
description = ''
|
description = ''
|
||||||
Plugins to lazy load.
|
Plugins to lazy load.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"release": "v0.6",
|
"release": "v0.7",
|
||||||
"isReleaseBranch": true
|
"isReleaseBranch": false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue