Merge branch 'main' into lazy-before-setup

This commit is contained in:
raf 2024-12-21 08:15:08 +03:00 committed by GitHub
commit f26744c6ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 49 deletions

View file

@ -92,7 +92,7 @@ in {
cmd = ${ cmd = ${
if isList cfg.dap.package if isList cfg.dap.package
then expToLua cfg.dap.package then expToLua cfg.dap.package
else ''${cfg.dap.package}/bin/haskell-debug-adapter'' else ''{"${cfg.dap.package}/bin/haskell-debug-adapter"}''
}, },
}, },
''} ''}

View file

@ -14,17 +14,9 @@ in {
startPlugins = ["nvim-notify"]; startPlugins = ["nvim-notify"];
pluginRC.nvim-notify = entryAnywhere '' pluginRC.nvim-notify = entryAnywhere ''
require('notify').setup(${toLuaObject cfg.setupOpts}) local notify = require("notify")
notify.setup(${toLuaObject cfg.setupOpts})
-- required to fix offset_encoding errors vim.notify = notify
local notify = vim.notify
vim.notify = function(msg, ...)
if msg:match("warning: multiple different client offset_encodings") then
return
end
notify(msg, ...)
end
''; '';
}; };
}; };

View file

@ -28,7 +28,7 @@ in {
}; };
stages = mkOption { stages = mkOption {
type = enum ["fade_in_slide_out" "fade_in" "slide_out" "none"]; type = enum ["fade_in_slide_out" "fade" "slide" "static"];
default = "fade_in_slide_out"; default = "fade_in_slide_out";
description = "The stages of the notification"; description = "The stages of the notification";
}; };
@ -41,7 +41,7 @@ in {
background_colour = mkOption { background_colour = mkOption {
type = str; type = str;
default = "#000000"; default = "NotifyBackground";
description = "The background colour of the notification"; description = "The background colour of the notification";
}; };

View file

@ -4,8 +4,8 @@
lib, lib,
... ...
}: let }: let
inherit (lib.strings) concatMapStringsSep;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
cfg = config.vim.utility.preview.markdownPreview; cfg = config.vim.utility.preview.markdownPreview;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -15,7 +15,7 @@ in {
mkdp_auto_start = cfg.autoStart; mkdp_auto_start = cfg.autoStart;
mkdp_auto_close = cfg.autoClose; mkdp_auto_close = cfg.autoClose;
mkdp_refresh_slow = cfg.lazyRefresh; mkdp_refresh_slow = cfg.lazyRefresh;
mkdp_filetypes = [(concatMapStringsSep ", " (x: "'" + x + "'") cfg.filetypes)]; mkdp_filetypes = cfg.filetypes;
mkdp_command_for_global = cfg.alwaysAllowPreview; mkdp_command_for_global = cfg.alwaysAllowPreview;
mkdp_open_to_the_world = cfg.broadcastServer; mkdp_open_to_the_world = cfg.broadcastServer;
mkdp_open_ip = cfg.customIP; mkdp_open_ip = cfg.customIP;

View file

@ -4,50 +4,32 @@
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.utility.surround; cfg = config.vim.utility.surround;
mkLznKey = mode: key: { mkLznKey = mode: key: {
inherit key mode; inherit mode key;
}; };
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
startPlugins = ["nvim-surround"];
pluginRC.surround = entryAnywhere "require('nvim-surround').setup(${toLuaObject cfg.setupOpts})";
lazy.plugins.nvim-surround = { lazy.plugins.nvim-surround = {
package = "nvim-surround"; package = "nvim-surround";
setupModule = "nvim-surround"; setupModule = "nvim-surround";
inherit (cfg) setupOpts; inherit (cfg) setupOpts;
keys = keys = [
[ (mkLznKey "i" cfg.setupOpts.keymaps.insert)
(mkLznKey ["i"] cfg.setupOpts.keymaps.insert) (mkLznKey "i" cfg.setupOpts.keymaps.insert_line)
(mkLznKey ["i"] cfg.setupOpts.keymaps.insert_line) (mkLznKey "x" cfg.setupOpts.keymaps.visual)
(mkLznKey ["x"] cfg.setupOpts.keymaps.visual) (mkLznKey "x" cfg.setupOpts.keymaps.visual_line)
(mkLznKey ["x"] cfg.setupOpts.keymaps.visual_line) (mkLznKey "n" cfg.setupOpts.keymaps.normal)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal) (mkLznKey "n" cfg.setupOpts.keymaps.normal_cur)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur) (mkLznKey "n" cfg.setupOpts.keymaps.normal_line)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_line) (mkLznKey "n" cfg.setupOpts.keymaps.normal_cur_line)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur_line) (mkLznKey "n" cfg.setupOpts.keymaps.delete)
(mkLznKey ["n"] cfg.setupOpts.keymaps.delete) (mkLznKey "n" cfg.setupOpts.keymaps.change)
(mkLznKey ["n"] cfg.setupOpts.keymaps.change) (mkLznKey "n" cfg.setupOpts.keymaps.change_line)
(mkLznKey ["n"] cfg.setupOpts.keymaps.change_line)
]
++ map (mkLznKey ["n" "i" "v"]) [
"<Plug>(nvim-surround-insert)"
"<Plug>(nvim-surround-insert-line)"
"<Plug>(nvim-surround-normal)"
"<Plug>(nvim-surround-normal-cur)"
"<Plug>(nvim-surround-normal-line)"
"<Plug>(nvim-surround-normal-cur-line)"
"<Plug>(nvim-surround-visual)"
"<Plug>(nvim-surround-visual-line)"
"<Plug>(nvim-surround-delete)"
"<Plug>(nvim-surround-change)"
"<Plug>(nvim-surround-change-line)"
]; ];
}; };
}; };