Skip to content

Commit

Permalink
Merge branch 'main' into add-hcl-not-terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
ppenguin authored Nov 23, 2024
2 parents 4d4235e + ea7469f commit 0d9ea35
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 2 deletions.
1 change: 1 addition & 0 deletions configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ isMaximal: {
motion = {
hop.enable = true;
leap.enable = true;
precognition.enable = isMaximal;
};

images = {
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/installation/standalone/home-manager.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Standalone Installation on Home-Manager {#ch-standalone-hm}

Your built Neoevim configuration can be exposed as a flake output to make it
Your built Neovim configuration can be exposed as a flake output to make it
easier to share across machines, repositories and so on. Or it can be added to
your system packages to make it available across your system.

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/installation/standalone/nixos.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Standalone Installation on NixOS {#ch-standalone-nixos}

Your built Neoevim configuration can be exposed as a flake output to make it
Your built Neovim configuration can be exposed as a flake output to make it
easier to share across machines, repositories and so on. Or it can be added to
your system packages to make it available across your system.

Expand Down
4 changes: 4 additions & 0 deletions docs/release-notes/rl-0.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,7 @@ everyone.
[Bloxx12](https://github.com/Bloxx12):

- Fix internal breakage in `elixir-tools` setup.

[Nowaaru](https://github.com/Nowaaru):

- Add `precognition-nvim`.
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,11 @@
flake = false;
};

plugin-precognition-nvim = {
url = "github:tris203/precognition.nvim";
flake = false;
};

# Note-taking
plugin-obsidian-nvim = {
url = "github:epwalsh/obsidian.nvim";
Expand Down
1 change: 1 addition & 0 deletions modules/plugins/utility/motion/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ _: {
imports = [
./hop
./leap
./precognition
];
}
18 changes: 18 additions & 0 deletions modules/plugins/utility/motion/precognition/config.nix
Original file line number Diff line number Diff line change
@@ -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 changes: 6 additions & 0 deletions modules/plugins/utility/motion/precognition/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
imports = [
./precognition.nix
./config.nix
];
}
66 changes: 66 additions & 0 deletions modules/plugins/utility/motion/precognition/precognition.nix
Original file line number Diff line number Diff line change
@@ -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 comments on commit 0d9ea35

Please sign in to comment.