mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-25 14:46:45 +00:00
utility/precognition: init module (#437)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* utility/precognition: init * utility/precognition: fix priority example, add default * utility/precognition: add files to default.nix * utility/precognition: fix typos, manual fmt * utility/precognition: remove useless mappings i was going to add binds to toggle/enable/disable but ehhh idk * utility/precognition: fix hints option it broke * utility/precognition: update gutter hints, new description * utility/precognition: add files to motion defaults * utility/precognition: add plugin to flake * utility/precognition: remove comment reference oops * utility/precognition: add precognition to maximal configuration it does work! * utility/precognition: update descriptions needs docs link, desc is somewhat obscure. * docs: add credit to release notes * utility/precognition: format * utility/precognition: de-linkify descriptions * utility/precognition: no more rec * utility/precognition: convert to setupOpts honestly raf was cooking with this one. it's much nicer to use compared to interpolation lol * utility/precognition: remove unnecessary function parameter * utility/precognition: format * utility/precognition: add description to disabled_fts oops * utility/precognition: manual format * utility/precognition: remove periods at the end of descriptions * utility/precognition: fix configuration.nix entry oops lol * utility/precognition: format * utility/precognition: expand `vim` * precognition: consistency changes Just my minor nits. --------- Co-authored-by: NotAShelf <raf@notashelf.dev>
This commit is contained in:
parent
8ff50562d7
commit
8997e62b3b
8 changed files with 118 additions and 0 deletions
|
@ -165,6 +165,7 @@ isMaximal: {
|
||||||
motion = {
|
motion = {
|
||||||
hop.enable = true;
|
hop.enable = true;
|
||||||
leap.enable = true;
|
leap.enable = true;
|
||||||
|
precognition.enable = isMaximal;
|
||||||
};
|
};
|
||||||
|
|
||||||
images = {
|
images = {
|
||||||
|
|
|
@ -216,3 +216,7 @@ everyone.
|
||||||
[Bloxx12](https://github.com/Bloxx12):
|
[Bloxx12](https://github.com/Bloxx12):
|
||||||
|
|
||||||
- Fix internal breakage in `elixir-tools` setup.
|
- Fix internal breakage in `elixir-tools` setup.
|
||||||
|
|
||||||
|
[Nowaaru](https://github.com/Nowaaru):
|
||||||
|
|
||||||
|
- Add `precognition-nvim`.
|
||||||
|
|
17
flake.lock
17
flake.lock
|
@ -1421,6 +1421,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugin-precognition-nvim": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1730325090,
|
||||||
|
"narHash": "sha256-onY1Aa+dwLR1wRua52hpSXj6zZOZXjkUlDjDa0xEEcE=",
|
||||||
|
"owner": "tris203",
|
||||||
|
"repo": "precognition.nvim",
|
||||||
|
"rev": "0189e8d6f96275a079b2805d68d49414871885cd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "tris203",
|
||||||
|
"repo": "precognition.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"plugin-project-nvim": {
|
"plugin-project-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -1880,6 +1896,7 @@
|
||||||
"plugin-otter-nvim": "plugin-otter-nvim",
|
"plugin-otter-nvim": "plugin-otter-nvim",
|
||||||
"plugin-oxocarbon": "plugin-oxocarbon",
|
"plugin-oxocarbon": "plugin-oxocarbon",
|
||||||
"plugin-plenary-nvim": "plugin-plenary-nvim",
|
"plugin-plenary-nvim": "plugin-plenary-nvim",
|
||||||
|
"plugin-precognition-nvim": "plugin-precognition-nvim",
|
||||||
"plugin-project-nvim": "plugin-project-nvim",
|
"plugin-project-nvim": "plugin-project-nvim",
|
||||||
"plugin-registers": "plugin-registers",
|
"plugin-registers": "plugin-registers",
|
||||||
"plugin-rose-pine": "plugin-rose-pine",
|
"plugin-rose-pine": "plugin-rose-pine",
|
||||||
|
|
|
@ -525,6 +525,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";
|
||||||
|
|
|
@ -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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue