From 4f616283992803ba5b3d2dc833b03f947c1573c6 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 16 Dec 2024 01:16:56 +0300 Subject: [PATCH 1/4] preview/markdown-preview: convert `mkdp_filetypes` to correct format --- modules/plugins/utility/preview/markdown-preview/config.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/plugins/utility/preview/markdown-preview/config.nix b/modules/plugins/utility/preview/markdown-preview/config.nix index 8349d3f..50fec81 100644 --- a/modules/plugins/utility/preview/markdown-preview/config.nix +++ b/modules/plugins/utility/preview/markdown-preview/config.nix @@ -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 { @@ -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; From 5d898da816dbfe117167fce3179f7757cbccb696 Mon Sep 17 00:00:00 2001 From: diniamo Date: Fri, 20 Dec 2024 16:27:44 +0100 Subject: [PATCH 2/4] nvim-notify: fix some stuff --- .../ui/notifications/nvim-notify/config.nix | 14 +++----------- .../ui/notifications/nvim-notify/nvim-notify.nix | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/modules/plugins/ui/notifications/nvim-notify/config.nix b/modules/plugins/ui/notifications/nvim-notify/config.nix index 0ee2301..5097217 100644 --- a/modules/plugins/ui/notifications/nvim-notify/config.nix +++ b/modules/plugins/ui/notifications/nvim-notify/config.nix @@ -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 ''; }; }; diff --git a/modules/plugins/ui/notifications/nvim-notify/nvim-notify.nix b/modules/plugins/ui/notifications/nvim-notify/nvim-notify.nix index f30d19c..b09100d 100644 --- a/modules/plugins/ui/notifications/nvim-notify/nvim-notify.nix +++ b/modules/plugins/ui/notifications/nvim-notify/nvim-notify.nix @@ -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"; }; @@ -41,7 +41,7 @@ in { background_colour = mkOption { type = str; - default = "#000000"; + default = "NotifyBackground"; description = "The background colour of the notification"; }; From 7eb8d07bcf91672a723c8ecf1df1e4e5df917f24 Mon Sep 17 00:00:00 2001 From: diniamo Date: Sat, 21 Dec 2024 01:14:52 +0100 Subject: [PATCH 3/4] surround: cleanup --- modules/plugins/utility/surround/config.nix | 48 +++++++-------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/modules/plugins/utility/surround/config.nix b/modules/plugins/utility/surround/config.nix index 7161cf6..31b4033 100644 --- a/modules/plugins/utility/surround/config.nix +++ b/modules/plugins/utility/surround/config.nix @@ -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"]) [ - "(nvim-surround-insert)" - "(nvim-surround-insert-line)" - "(nvim-surround-normal)" - "(nvim-surround-normal-cur)" - "(nvim-surround-normal-line)" - "(nvim-surround-normal-cur-line)" - "(nvim-surround-visual)" - "(nvim-surround-visual-line)" - "(nvim-surround-delete)" - "(nvim-surround-change)" - "(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) + ]; }; }; }; From 0946d439210b19eee5fb57d8ec0ae563de5deb49 Mon Sep 17 00:00:00 2001 From: Artur Manuel Date: Sat, 21 Dec 2024 00:51:41 +0000 Subject: [PATCH 4/4] languages/haskell: fix DAP command definition --- modules/plugins/languages/haskell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/languages/haskell.nix b/modules/plugins/languages/haskell.nix index f8e17b7..62f4cd4 100644 --- a/modules/plugins/languages/haskell.nix +++ b/modules/plugins/languages/haskell.nix @@ -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"}'' }, }, ''}