mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
Merge branch 'main' into telescope-ext
This commit is contained in:
commit
49b748072b
90 changed files with 1935 additions and 1108 deletions
|
@ -15,8 +15,10 @@
|
|||
./multicursors
|
||||
./new-file-template
|
||||
./nix-develop
|
||||
./oil-nvim
|
||||
./outline
|
||||
./preview
|
||||
./sleuth
|
||||
./snacks-nvim
|
||||
./surround
|
||||
./telescope
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
20
modules/plugins/utility/oil-nvim/config.nix
Normal file
20
modules/plugins/utility/oil-nvim/config.nix
Normal 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});
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/utility/oil-nvim/default.nix
Normal file
6
modules/plugins/utility/oil-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./oil-nvim.nix
|
||||
];
|
||||
}
|
12
modules/plugins/utility/oil-nvim/oil-nvim.nix
Normal file
12
modules/plugins/utility/oil-nvim/oil-nvim.nix
Normal 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" {};
|
||||
};
|
||||
}
|
10
modules/plugins/utility/sleuth/config.nix
Normal file
10
modules/plugins/utility/sleuth/config.nix
Normal 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"];
|
||||
}
|
6
modules/plugins/utility/sleuth/default.nix
Normal file
6
modules/plugins/utility/sleuth/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./sleuth.nix
|
||||
];
|
||||
}
|
7
modules/plugins/utility/sleuth/sleuth.nix
Normal file
7
modules/plugins/utility/sleuth/sleuth.nix
Normal 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`
|
||||
'';
|
||||
}
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue