Compare commits
2 commits
87709b98dd
...
8628fb2ed8
Author | SHA1 | Date | |
---|---|---|---|
8628fb2ed8 | |||
0bb649270c |
3 changed files with 59 additions and 1 deletions
|
@ -14,6 +14,7 @@
|
|||
./modules/plugins/theme/catppuccin.nix
|
||||
./modules/plugins/style/neoformat.nix
|
||||
./modules/plugins/style/nvim-treesitter.nix
|
||||
./modules/plugins/navigation/hop-nvim.nix
|
||||
./modules/plugins/navigation/telescope.nix
|
||||
./modules/plugins/navigation/nvim-tree.nix
|
||||
./modules/plugins/gitsigns.nix
|
||||
|
|
|
@ -63,7 +63,7 @@ let
|
|||
|
||||
genConfig = with lib.nix2lua; lib.mkIf (!config.isDependency) (lib.flatten [
|
||||
(local (set config.varName (require config.name)))
|
||||
(lib.mapAttrsToList (k: v: local (set k) (require v)) config.extraImports)
|
||||
(lib.mapAttrsToList (k: v: local (set k (require v))) config.extraImports)
|
||||
config.beforeSetup
|
||||
(lib.optional (config.setupSettings != null)
|
||||
(pipe1 (var config.varName) (call config.setupFnName config.setupSettings))
|
||||
|
|
57
modules/plugins/navigation/hop-nvim.nix
Normal file
57
modules/plugins/navigation/hop-nvim.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.plugins.navigation.hop-nvim;
|
||||
in
|
||||
{
|
||||
options.plugins.navigation.hop-nvim = with lib; {
|
||||
enable = mkEnableOption "hop-nvim";
|
||||
|
||||
package = mkPackageOption pkgs.vimPlugins "hop-nvim" { };
|
||||
|
||||
settings = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
};
|
||||
|
||||
keymap.set = mkOption {
|
||||
type = with types; functionTo (listOf keymap);
|
||||
default = dir: [ ];
|
||||
defaultText = literalExpression "dir: []";
|
||||
example = literalExpression ''
|
||||
{ after, before }: [
|
||||
{ lhs = "<leader>hc"; rhs = "<CMD>HopChar1<CR>"; }
|
||||
{
|
||||
lhs = "<leader>hf";
|
||||
rhs = lambda0 (call "hop.hint_char1" {
|
||||
direction = after;
|
||||
current_line_only = true;
|
||||
});
|
||||
}
|
||||
{
|
||||
lhs = "<leader>hF";
|
||||
rhs = lambda0 (call "hop.hint_char1" {
|
||||
direction = before;
|
||||
current_line_only = true;
|
||||
});
|
||||
}
|
||||
]
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
plugin.hop-nvim = {
|
||||
name = "hop";
|
||||
extraImports = { hop_hint = "hop.hint"; };
|
||||
package = cfg.package;
|
||||
setupSettings = cfg.settings;
|
||||
};
|
||||
|
||||
vim.keymap.set = with lib.nix2lua; cfg.keymap.set {
|
||||
after = var "hop_hint.HintDirection.AFTER_CURSOR";
|
||||
before = var "hop_hint.HintDirection.BEFORE_CURSOR";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in a new issue