mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
feat: add flash.nvim
A motion plugin, from Folke. https://github.com/folke/flash.nvim
This commit is contained in:
parent
dafe978ffa
commit
514d4da2d3
6 changed files with 97 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./flash
|
||||
./hop
|
||||
./leap
|
||||
./precognition
|
||||
|
|
34
modules/plugins/utility/motion/flash/config.nix
Normal file
34
modules/plugins/utility/motion/flash/config.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.binds) mkKeymap;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.utility.motion.flash-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
lazy.plugins = {
|
||||
"flash-nvim" = {
|
||||
package = "flash-nvim";
|
||||
setupModule = "flash";
|
||||
setupOpts = cfg.setupOpts;
|
||||
|
||||
lazy = true;
|
||||
|
||||
keys = [
|
||||
(mkKeymap ["n" "o" "x"] cfg.mappings.jump "<cmd>lua require(\"flash\").jump()<cr>" {desc = "Flash";})
|
||||
(mkKeymap ["n" "o" "x"] cfg.mappings.treesitter "<cmd>lua require(\"flash\").treesitter()<cr>" {desc = "Flash Treesitter";})
|
||||
(mkKeymap "o" cfg.mappings.remote "<cmd>lua require(\"flash\").remote()<cr>" {desc = "Remote Flash";})
|
||||
(mkKeymap ["o" "x"] cfg.mappings.treesitter_search "<cmd>lua require(\"flash\").treesitter_search()<cr>" {desc = "Treesitter Search";})
|
||||
(mkKeymap "c" cfg.mappings.toggle "<cmd>lua require(\"flash\").toggle()<cr>" {desc = "Toggle Flash Search";})
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/utility/motion/flash/default.nix
Normal file
6
modules/plugins/utility/motion/flash/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./flash.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
38
modules/plugins/utility/motion/flash/flash.nix
Normal file
38
modules/plugins/utility/motion/flash/flash.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) nullOr str;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.utility.motion.flash-nvim = {
|
||||
enable = mkEnableOption "enhanced code navigation with flash.nvim";
|
||||
setupOpts = mkPluginSetupOption "flash-nvim" {};
|
||||
|
||||
mappings = {
|
||||
jump = mkOption {
|
||||
type = nullOr str;
|
||||
default = "s";
|
||||
description = "Jump";
|
||||
};
|
||||
treesitter = mkOption {
|
||||
type = nullOr str;
|
||||
default = "S";
|
||||
description = "Treesitter";
|
||||
};
|
||||
remote = mkOption {
|
||||
type = nullOr str;
|
||||
default = "r";
|
||||
description = "Remote Flash";
|
||||
};
|
||||
treesitter_search = mkOption {
|
||||
type = nullOr str;
|
||||
default = "R";
|
||||
description = "Treesitter Search";
|
||||
};
|
||||
toggle = mkOption {
|
||||
type = nullOr str;
|
||||
default = "<c-s>";
|
||||
description = "Toggle Flash Search";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue