From 262a6fe785d56a5748ba590484f3499b370dbbb8 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 1 Jul 2024 08:32:37 +0200 Subject: [PATCH] vimPlugins.Preview-nvim: init at 2024-06-01 --- .../editors/vim/plugins/generated.nix | 12 ++++++++++ .../editors/vim/plugins/overrides.nix | 11 ++++++++++ .../hardcode-mdt-binary-path.patch | 22 +++++++++++++++++++ .../editors/vim/plugins/vim-plugin-names | 1 + 4 files changed, 46 insertions(+) create mode 100644 pkgs/applications/editors/vim/plugins/patches/preview-nvim/hardcode-mdt-binary-path.patch diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index 213806b2f402..f6809c3db646 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -17515,5 +17515,17 @@ final: prev: meta.homepage = "https://github.com/jhradilek/vim-snippets/"; }; + Preview-nvim = buildVimPlugin { + pname = "Preview.nvim"; + version = "2024-06-01"; + src = fetchFromGitHub { + owner = "henriklovhaug"; + repo = "Preview.nvim"; + rev = "388882f3bfd09bcb0d5b4ab3d0fa5bc2dacbbc2e"; + sha256 = "sha256-Tnl2TkLY9QXk/5qX2LcX5G2aq/sysH6BnD2YqXlneIU="; + }; + meta.homepage = "https://github.com/henriklovhaug/Preview.nvim/"; + }; + } diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index f2d7640a83e1..727962f8340b 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -79,6 +79,8 @@ , CoreServices , # nvim-treesitter dependencies callPackage +, # Preview-nvim dependencies + md-tui , # sg.nvim dependencies darwin , # sved dependencies @@ -1275,6 +1277,15 @@ nvimRequireCheck = "plenary"; }; + Preview-nvim = super.Preview-nvim.overrideAttrs { + patches = [ + (substituteAll { + src = ./patches/preview-nvim/hardcode-mdt-binary-path.patch; + mdt = lib.getExe md-tui; + }) + ]; + }; + range-highlight-nvim = super.range-highlight-nvim.overrideAttrs { dependencies = with self; [ cmd-parser-nvim ]; }; diff --git a/pkgs/applications/editors/vim/plugins/patches/preview-nvim/hardcode-mdt-binary-path.patch b/pkgs/applications/editors/vim/plugins/patches/preview-nvim/hardcode-mdt-binary-path.patch new file mode 100644 index 000000000000..e8082f51c370 --- /dev/null +++ b/pkgs/applications/editors/vim/plugins/patches/preview-nvim/hardcode-mdt-binary-path.patch @@ -0,0 +1,22 @@ +diff --git a/lua/preview.lua b/lua/preview.lua +index 6d9875d..729cc70 100644 +--- a/lua/preview.lua ++++ b/lua/preview.lua +@@ -28,7 +28,7 @@ local function open_window(file) + vim.env.MDT_WIDTH = width + + vim.cmd.vnew() +- vim.fn.termopen("mdt " .. file) ++ vim.fn.termopen("@mdt@ " .. file) + + vim.cmd("setlocal nonumber norelativenumber") + vim.api.nvim_feedkeys("a", "t", false) +@@ -49,7 +49,7 @@ end + function M.setup() + -- Check if "mdt" is installed + if vim.fn.executable("mdt") == 0 then +- install() ++ -- install() + end + + set_cmd() diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index 98f71881c900..75dd02f39622 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -21,6 +21,7 @@ https://github.com/numToStr/Navigator.nvim/,, https://github.com/overcache/NeoSolarized/,, https://github.com/chrisbra/NrrwRgn/,, https://github.com/vim-scripts/PreserveNoEOL/,, +https://github.com/henriklovhaug/Preview.nvim/,HEAD, https://github.com/yssl/QFEnter/,, https://github.com/chrisbra/Recover.vim/,, https://github.com/vim-scripts/Rename/,,