Merge branch 'main' into v0.7

This commit is contained in:
raf 2024-11-08 09:33:15 +00:00 committed by GitHub
commit b3f51048db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 119 additions and 0 deletions

View file

@ -164,6 +164,7 @@ isMaximal: {
motion = { motion = {
hop.enable = true; hop.enable = true;
leap.enable = true; leap.enable = true;
precognition.enable = isMaximal;
}; };
images = { images = {

View file

@ -322,3 +322,8 @@ 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`.

View file

@ -1614,6 +1614,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": {
@ -2085,6 +2101,7 @@
"plugin-oxocarbon": "plugin-oxocarbon", "plugin-oxocarbon": "plugin-oxocarbon",
"plugin-pathlib-nvim": "plugin-pathlib-nvim", "plugin-pathlib-nvim": "plugin-pathlib-nvim",
"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",

View file

@ -566,6 +566,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";

View file

@ -2,5 +2,6 @@ _: {
imports = [ imports = [
./hop ./hop
./leap ./leap
./precognition
]; ];
} }

View 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})
'';
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./precognition.nix
./config.nix
];
}

View 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
'';
};
};
}