-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-hcl-not-terraform
- Loading branch information
Showing
10 changed files
with
120 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ _: { | |
imports = [ | ||
./hop | ||
./leap | ||
./precognition | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
66
modules/plugins/utility/motion/precognition/precognition.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
''; | ||
}; | ||
}; | ||
} |