mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-07 10:51:36 +00:00
Merge branch 'main' into telescope-ext
This commit is contained in:
commit
f2531e456c
105 changed files with 3657 additions and 4148 deletions
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
];
|
||||
}
|
||||
|
|
26
modules/plugins/utility/leetcode-nvim/config.nix
Normal file
26
modules/plugins/utility/leetcode-nvim/config.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/utility/leetcode-nvim/default.nix
Normal file
6
modules/plugins/utility/leetcode-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./leetcode-nvim.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
74
modules/plugins/utility/leetcode-nvim/leetcode-nvim.nix
Normal file
74
modules/plugins/utility/leetcode-nvim/leetcode-nvim.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -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.
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -99,12 +99,6 @@
|
|||
type = float;
|
||||
default = 0.55;
|
||||
};
|
||||
|
||||
results_width = mkOption {
|
||||
description = "";
|
||||
type = float;
|
||||
default = 0.8;
|
||||
};
|
||||
};
|
||||
|
||||
vertical = {
|
||||
|
|
32
modules/plugins/utility/yanky-nvim/config.nix
Normal file
32
modules/plugins/utility/yanky-nvim/config.nix
Normal 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});
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/utility/yanky-nvim/default.nix
Normal file
6
modules/plugins/utility/yanky-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./yanky-nvim.nix
|
||||
];
|
||||
}
|
28
modules/plugins/utility/yanky-nvim/yanky-nvim.nix
Normal file
28
modules/plugins/utility/yanky-nvim/yanky-nvim.nix
Normal 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.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue