Merge branch 'main' into telescope-ext

This commit is contained in:
raf 2025-04-28 05:45:55 +00:00 committed by GitHub
commit 49b748072b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
90 changed files with 1935 additions and 1108 deletions

View file

@ -15,8 +15,10 @@
./multicursors
./new-file-template
./nix-develop
./oil-nvim
./outline
./preview
./sleuth
./snacks-nvim
./surround
./telescope

View file

@ -1,15 +1,21 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib.types) nullOr enum;
inherit (lib.types) enum str;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.nvim.types) mkPluginSetupOption borderType;
in {
options.vim.fzf-lua = {
enable = mkEnableOption "fzf-lua";
setupOpts = mkPluginSetupOption "fzf-lua" {
fzf_bin = mkOption {
type = str;
default = "${lib.getExe pkgs.fzf}";
description = "Path to fzf executable";
};
winopts.border = mkOption {
type = borderType;
default = config.vim.ui.borders.globalStyle;

View file

@ -1,5 +1,6 @@
_: {
imports = [
./flash
./hop
./leap
./precognition

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

View file

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

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

View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.oil-nvim;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["oil-nvim"];
pluginRC.oil-nvim = entryAnywhere ''
require("oil").setup(${toLuaObject cfg.setupOpts});
'';
};
};
}

View file

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

View file

@ -0,0 +1,12 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.utility.oil-nvim = {
enable = mkEnableOption ''
Neovim file explorer: edit your filesystem like a buffer [oil-nvim]
'';
setupOpts = mkPluginSetupOption "oil-nvim" {};
};
}

View file

@ -0,0 +1,10 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.vim.utility.sleuth;
in {
vim.startPlugins = mkIf cfg.enable ["vim-sleuth"];
}

View file

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

View file

@ -0,0 +1,7 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
in {
options.vim.utility.sleuth.enable = mkEnableOption ''
automatically adjusting options such as `shiftwidth` or `expandtab`, using `vim-sleuth`
'';
}

View file

@ -11,6 +11,12 @@
cfg = config.vim.telescope;
setupOptions = {
pickers.find_files.find_command = mkOption {
description = "cmd to use for finding files";
type = either (listOf str) luaInline;
default = ["${pkgs.fd}/bin/fd" "--type=file"];
};
defaults = {
vimgrep_arguments = mkOption {
type = listOf str;
@ -138,8 +144,7 @@
file_ignore_patterns = mkOption {
type = listOf str;
default = ["node_modules" ".git/" "dist/" "build/" "target/" "result/"];
description = "A table of lua regex that define the files that should be ignored.";
default = ["node_modules" "%.git/" "dist/" "build/" "target/" "result/"];
};
color_devicons = mkOption {