Merge branch 'v0.8' into feat/roslyn-ls

This commit is contained in:
CaueDosAnjos 2025-12-11 10:04:50 -03:00 committed by GitHub
commit 9e90201e57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
101 changed files with 4103 additions and 2080 deletions

View file

@ -19,6 +19,7 @@
./oil-nvim
./outline
./preview
./qmk-nvim
./sleuth
./smart-splits
./snacks-nvim

View file

@ -1,6 +1,7 @@
{
config,
lib,
options,
...
}: let
inherit (lib.modules) mkIf mkMerge;
@ -9,9 +10,7 @@
cfg = config.vim.gestures.gesture-nvim;
self = import ./gesture-nvim.nix {inherit lib;};
mappingDefinitions = self.options.vim.gestures.gesture-nvim.mappings;
mappingDefinitions = options.vim.gestures.gesture-nvim.mappings;
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in {
config = mkIf cfg.enable {

View file

@ -14,7 +14,7 @@ in {
"flash-nvim" = {
package = "flash-nvim";
setupModule = "flash";
setupOpts = cfg.setupOpts;
inherit (cfg) setupOpts;
lazy = true;

View file

@ -1,6 +1,7 @@
{
config,
lib,
options,
...
}: let
inherit (lib.modules) mkIf;
@ -9,13 +10,11 @@
cfg = config.vim.utility.motion.hop;
self = import ./hop.nix {inherit lib;};
mappingDefinitions = self.options.vim.utility.motion.hop.mappings;
mappingDefinitions = options.vim.utility.motion.hop.mappings;
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in {
config = mkIf cfg.enable {
vim.startPlugins = ["hop-nvim"];
vim.startPlugins = ["hop.nvim"];
vim.maps.normal = mkSetBinding mappings.hop "<cmd> HopPattern<CR>";

View file

@ -3,18 +3,38 @@
lib,
...
}: let
inherit (lib.attrsets) optionalAttrs recursiveUpdate;
inherit (lib.lists) optionals;
inherit (lib.modules) mkIf;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.dag) entryAfter 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});
'';
startPlugins = ["oil-nvim"] ++ (optionals cfg.gitStatus.enable ["oil-git-status.nvim"]);
pluginRC.oil-nvim = let
gitStatusDefaultOpts = {
# https://github.com/refractalize/oil-git-status.nvim?tab=readme-ov-file#configuration
win_options = {
signcolumn = "yes:2";
};
};
setupOpts =
recursiveUpdate
(optionalAttrs cfg.gitStatus.enable gitStatusDefaultOpts)
cfg.setupOpts;
in
entryAnywhere ''
require("oil").setup(${toLuaObject setupOpts});
'';
pluginRC.oil-git-status-nvim = mkIf cfg.gitStatus.enable (entryAfter ["oil-nvim"] ''
require("oil-git-status").setup(${toLuaObject cfg.gitStatus.setupOpts})
'');
};
};
}

View file

@ -8,5 +8,13 @@ in {
'';
setupOpts = mkPluginSetupOption "oil-nvim" {};
gitStatus = {
enable = mkEnableOption ''
Git status on [oil-nvim] directory listings
'';
setupOpts = mkPluginSetupOption "oil-git-status-nvim" {};
};
};
}

View file

@ -2,6 +2,7 @@
pkgs,
config,
lib,
options,
...
}: let
inherit (lib.modules) mkIf mkMerge;
@ -9,10 +10,7 @@
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.preview.glow;
self = import ./glow.nix {
inherit lib config pkgs;
};
inherit (self.options.vim.utility.preview.glow) mappings;
inherit (options.vim.utility.preview.glow) mappings;
in {
config = mkIf cfg.enable {
vim.startPlugins = ["glow-nvim"];

View file

@ -0,0 +1,36 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAfter;
cfg = config.vim.utility.qmk-nvim;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["qmk-nvim"];
pluginRC.qmk-nvim = entryAfter ["nvim-notify"] ''
require('qmk').setup(${toLuaObject cfg.setupOpts})
'';
};
assertions = [
{
assertion = cfg.setupOpts.variant == "qmk" && cfg.setupOpts.comment_preview.position != "inside";
message = "comment_preview.position can only be set to inside when using the qmk layoyt";
}
{
assertion = cfg.setupOpts.name != null;
message = "qmk-nvim requires 'vim.utility.qmk.setupOpts.name' to be set.";
}
{
assertion = cfg.setupOpts.layout != null;
message = "qmk-nvim requires 'vim.utility.qmk.setupOpts.layout' to be set.";
}
];
};
}

View file

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

View file

@ -0,0 +1,49 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) attrsOf nullOr enum lines str;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.utility.qmk-nvim = {
enable = mkEnableOption "QMK and ZMK keymaps in nvim";
setupOpts = mkPluginSetupOption "qmk.nvim" {
name = mkOption {
type = nullOr str;
default = null;
description = "The name of the layout";
};
layout = mkOption {
type = nullOr lines;
default = null;
description = ''
The keyboard key layout
see <https://github.com/codethread/qmk.nvim?tab=readme-ov-file#Layout> for more details
'';
};
variant = mkOption {
type = enum ["qmk" "zmk"];
default = "qmk";
description = "Chooses the expected hardware target";
};
comment_preview = {
position = mkOption {
type = enum ["top" "bottom" "inside" "none"];
default = "top";
description = "Controls the position of the preview";
};
keymap_overrides = mkOption {
type = attrsOf str;
default = {};
description = ''
Key codes to text replacements
see <https://github.com/codethread/qmk.nvim/blob/main/lua/qmk/config/key_map.lua> for more details
'';
};
};
};
};
}