Merge branch 'main' into telescope-ext

This commit is contained in:
raf 2025-02-17 00:20:31 +00:00 committed by GitHub
commit f2531e456c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
105 changed files with 3657 additions and 4148 deletions

View file

@ -14,7 +14,7 @@
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["which-key"];
startPlugins = ["which-key-nvim"];
pluginRC.whichkey = entryAnywhere ''
local wk = require("which-key")

View file

@ -9,9 +9,7 @@
cfg = config.vim.utility.ccc;
in {
config = mkIf cfg.enable {
vim.startPlugins = [
"ccc"
];
vim.startPlugins = ["ccc-nvim"];
vim.pluginRC.ccc = entryAnywhere ''
local ccc = require("ccc")

View file

@ -3,6 +3,7 @@
./binds
./ccc
./diffview
./fzf-lua
./gestures
./icon-picker
./images
@ -13,8 +14,7 @@
./surround
./telescope
./wakatime
./surround
./preview
./fzf-lua
./yanky-nvim
./leetcode-nvim
];
}

View file

@ -0,0 +1,26 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.vim.utility.leetcode-nvim;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"leetcode-nvim"
"plenary-nvim"
"fzf-lua"
"nui-nvim"
];
lazy.plugins.leetcode-nvim = {
package = "leetcode-nvim";
setupModule = "leetcode";
inherit (cfg) setupOpts;
};
};
};
}

View file

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

View file

@ -0,0 +1,74 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) enum str bool;
inherit (lib.generators) mkLuaInline;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
in {
options.vim.utility = {
leetcode-nvim = {
enable = mkEnableOption "complementary neovim plugin for leetcode.nvim";
setupOpts = mkPluginSetupOption "leetcode-nvim" {
logging = mkEnableOption "logging for leetcode.nvim status notifications." // {default = true;};
image_support = mkEnableOption "question description images using image.nvim (image-nvim must be enabled).";
lang = mkOption {
type = enum [
"cpp"
"java"
"python"
"python3"
"c"
"csharp"
"javascript"
"typescript"
"php"
"swift"
"kotlin"
"dart"
"golang"
"ruby"
"scala"
"rust"
"racket"
"erlang"
"elixir"
"bash"
];
default = "python3";
description = "Language to start your session with";
};
arg = mkOption {
type = str;
default = "leetcode.nvim";
description = "Argument for Neovim";
};
cn = {
enabled = mkEnableOption "leetcode.cn instead of leetcode.com";
translator = mkEnableOption "translator" // {default = true;};
translate_problems = mkEnableOption "translation for problem questions" // {default = true;};
};
storage = {
home = mkOption {
type = luaInline;
default = mkLuaInline "vim.fn.stdpath(\"data\") .. \"/leetcode\"";
description = "Home storage directory";
};
cache = mkOption {
type = luaInline;
default = mkLuaInline "vim.fn.stdpath(\"cache\") .. \"/leetcode\"";
description = "Cache storage directory";
};
};
plugins = {
non_standalone = mkEnableOption "leetcode.nvim in a non-standalone mode";
};
};
};
};
}

View file

@ -38,7 +38,7 @@ in {
default = false;
description = ''
nvim-surround: add/change/delete surrounding delimiter pairs with ease.
Note that the default mappings deviate from upstreeam to avoid conflicts
Note that the default mappings deviate from upstream to avoid conflicts
with nvim-leap.
'';
};

View file

@ -99,12 +99,6 @@
type = float;
default = 0.55;
};
results_width = mkOption {
description = "";
type = float;
default = 0.8;
};
};
vertical = {

View file

@ -0,0 +1,32 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.lists) optionals concatLists;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.yanky-nvim;
usingSqlite = cfg.setupOpts.ring.storage == "sqlite";
in {
config = mkIf cfg.enable {
vim = {
# TODO: this could probably be lazyloaded. I'm not yet sure which event is
# ideal, so it's loaded normally for now.
startPlugins = concatLists [
["yanky-nvim"]
# If using the sqlite backend, sqlite-lua must be loaded
# alongside yanky.
(optionals usingSqlite [pkgs.vimPlugins.sqlite-lua])
];
pluginRC.yanky-nvim = entryAnywhere ''
require("yanky").setup(${toLuaObject cfg.setupOpts});
'';
};
};
}

View file

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

View file

@ -0,0 +1,28 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) enum;
in {
options.vim.utility.yanky-nvim = {
enable = mkEnableOption ''
improved Yank and Put functionalities for Neovim [yanky-nvim]
'';
setupOpts = {
ring.storage = mkOption {
type = enum ["shada" "sqlite" "memory"];
default = "shada";
example = "sqlite";
description = ''
storage mode for ring values.
- shada: this will save pesistantly using Neovim ShaDa feature.
This means that history will be persisted between each session of Neovim.
- memory: each Neovim instance will have his own history and it will be
lost between sessions.
- sqlite: more reliable than `shada`, requires `sqlite.lua` as a dependency.
nvf will add this dependency to `PATH` automatically.
'';
};
};
};
}