Skip to content

Commit

Permalink
Merge branch 'main' into lazy-before-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAShelf authored Dec 21, 2024
2 parents ed69816 + 62d296a commit f26744c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 49 deletions.
2 changes: 1 addition & 1 deletion modules/plugins/languages/haskell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ in {
cmd = ${
if isList cfg.dap.package
then expToLua cfg.dap.package
else ''${cfg.dap.package}/bin/haskell-debug-adapter''
else ''{"${cfg.dap.package}/bin/haskell-debug-adapter"}''
},
},
''}
Expand Down
14 changes: 3 additions & 11 deletions modules/plugins/ui/notifications/nvim-notify/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,9 @@ in {
startPlugins = ["nvim-notify"];

pluginRC.nvim-notify = entryAnywhere ''
require('notify').setup(${toLuaObject cfg.setupOpts})
-- required to fix offset_encoding errors
local notify = vim.notify
vim.notify = function(msg, ...)
if msg:match("warning: multiple different client offset_encodings") then
return
end
notify(msg, ...)
end
local notify = require("notify")
notify.setup(${toLuaObject cfg.setupOpts})
vim.notify = notify
'';
};
};
Expand Down
4 changes: 2 additions & 2 deletions modules/plugins/ui/notifications/nvim-notify/nvim-notify.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ in {
};

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";
description = "The stages of the notification";
};
Expand All @@ -41,7 +41,7 @@ in {

background_colour = mkOption {
type = str;
default = "#000000";
default = "NotifyBackground";
description = "The background colour of the notification";
};

Expand Down
4 changes: 2 additions & 2 deletions modules/plugins/utility/preview/markdown-preview/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
lib,
...
}: let
inherit (lib.strings) concatMapStringsSep;
inherit (lib.modules) mkIf;

cfg = config.vim.utility.preview.markdownPreview;
in {
config = mkIf cfg.enable {
Expand All @@ -15,7 +15,7 @@ in {
mkdp_auto_start = cfg.autoStart;
mkdp_auto_close = cfg.autoClose;
mkdp_refresh_slow = cfg.lazyRefresh;
mkdp_filetypes = [(concatMapStringsSep ", " (x: "'" + x + "'") cfg.filetypes)];
mkdp_filetypes = cfg.filetypes;
mkdp_command_for_global = cfg.alwaysAllowPreview;
mkdp_open_to_the_world = cfg.broadcastServer;
mkdp_open_ip = cfg.customIP;
Expand Down
48 changes: 15 additions & 33 deletions modules/plugins/utility/surround/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,33 @@
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;

cfg = config.vim.utility.surround;
mkLznKey = mode: key: {
inherit key mode;
inherit mode key;
};
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["nvim-surround"];
pluginRC.surround = entryAnywhere "require('nvim-surround').setup(${toLuaObject cfg.setupOpts})";

lazy.plugins.nvim-surround = {
package = "nvim-surround";

setupModule = "nvim-surround";
inherit (cfg) setupOpts;

keys =
[
(mkLznKey ["i"] cfg.setupOpts.keymaps.insert)
(mkLznKey ["i"] cfg.setupOpts.keymaps.insert_line)
(mkLznKey ["x"] cfg.setupOpts.keymaps.visual)
(mkLznKey ["x"] cfg.setupOpts.keymaps.visual_line)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_line)
(mkLznKey ["n"] cfg.setupOpts.keymaps.normal_cur_line)
(mkLznKey ["n"] cfg.setupOpts.keymaps.delete)
(mkLznKey ["n"] cfg.setupOpts.keymaps.change)
(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)"
];
keys = [
(mkLznKey "i" cfg.setupOpts.keymaps.insert)
(mkLznKey "i" cfg.setupOpts.keymaps.insert_line)
(mkLznKey "x" cfg.setupOpts.keymaps.visual)
(mkLznKey "x" cfg.setupOpts.keymaps.visual_line)
(mkLznKey "n" cfg.setupOpts.keymaps.normal)
(mkLznKey "n" cfg.setupOpts.keymaps.normal_cur)
(mkLznKey "n" cfg.setupOpts.keymaps.normal_line)
(mkLznKey "n" cfg.setupOpts.keymaps.normal_cur_line)
(mkLznKey "n" cfg.setupOpts.keymaps.delete)
(mkLznKey "n" cfg.setupOpts.keymaps.change)
(mkLznKey "n" cfg.setupOpts.keymaps.change_line)
];
};
};
};
Expand Down

0 comments on commit f26744c

Please sign in to comment.