From 2c16fd044911cd3c2450f4b17dc9d7152f4a9da3 Mon Sep 17 00:00:00 2001 From: PerchunPak Date: Fri, 23 Aug 2024 09:04:35 +0200 Subject: [PATCH] vimPlugins.ranger-nvim: init at 2024-02-09 --- .../editors/vim/plugins/generated.nix | 12 ++++++++++ .../editors/vim/plugins/overrides.nix | 9 ++++++++ .../patches/ranger.nvim/fix-paths.patch | 22 +++++++++++++++++++ .../editors/vim/plugins/vim-plugin-names | 1 + 4 files changed, 44 insertions(+) create mode 100644 pkgs/applications/editors/vim/plugins/patches/ranger.nvim/fix-paths.patch diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index b5cb9fefa3f4..ae1ae11dc36b 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -9666,6 +9666,18 @@ final: prev: meta.homepage = "https://github.com/winston0410/range-highlight.nvim/"; }; + ranger-nvim = buildVimPlugin { + pname = "ranger.nvim"; + version = "2024-02-09"; + src = fetchFromGitHub { + owner = "kelly-lin"; + repo = "ranger.nvim"; + rev = "d3b032feee6b3b0cf923222f260523e2bd7f3ad3"; + sha256 = "07c0rri7v0z9hjdj3vqsqjms43y2a9kqqac2s5is7ksz2hqi5yzj"; + }; + meta.homepage = "https://github.com/kelly-lin/ranger.nvim/"; + }; + ranger-vim = buildVimPlugin { pname = "ranger.vim"; version = "2021-12-13"; diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index 1c4368c4469c..d04665778b50 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -40,6 +40,7 @@ , pandoc , parinfer-rust , phpactor +, ranger , ripgrep , skim , sqlite @@ -1383,6 +1384,14 @@ dependencies = with self; [ cmd-parser-nvim ]; }; + ranger-nvim = super.ranger-nvim.overrideAttrs { + patches = [ ./patches/ranger.nvim/fix-paths.patch ]; + + postPatch = '' + substituteInPlace lua/ranger-nvim.lua --replace '@ranger@' ${ranger} + ''; + }; + refactoring-nvim = super.refactoring-nvim.overrideAttrs { dependencies = with self; [ nvim-treesitter plenary-nvim ]; }; diff --git a/pkgs/applications/editors/vim/plugins/patches/ranger.nvim/fix-paths.patch b/pkgs/applications/editors/vim/plugins/patches/ranger.nvim/fix-paths.patch new file mode 100644 index 000000000000..496df312b4c7 --- /dev/null +++ b/pkgs/applications/editors/vim/plugins/patches/ranger.nvim/fix-paths.patch @@ -0,0 +1,22 @@ +diff --git a/lua/ranger-nvim.lua b/lua/ranger-nvim.lua +index 3b18880..78eb9db 100644 +--- a/lua/ranger-nvim.lua ++++ b/lua/ranger-nvim.lua +@@ -109,7 +109,7 @@ local function build_ranger_cmd(select_current_file) + end + local selectfile_flag = select_current_file and " --selectfile=" .. selected_file or "" + return string.format( +- "ranger --choosefiles=%s %s %s", ++ "@ranger@ --choosefiles=%s %s %s", + SELECTED_FILEPATH, + selectfile_flag, + create_ranger_cmd_flags(create_cmd_values(opts.keybinds)) +@@ -182,7 +182,7 @@ end + ---Opens ranger and open selected files on exit. + ---@param select_current_file boolean|nil open ranger and select the current file. Defaults to true. + function M.open(select_current_file) +- if vim.fn.executable("ranger") ~= 1 then ++ if vim.fn.executable("@ranger@") ~= 1 then + vim.api.nvim_err_write( + "ranger executable not found, please check that ranger is installed and is in your path\n" + ) diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index 0c98690b58e5..67516e83fb17 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -812,6 +812,7 @@ https://gitlab.com/HiPhish/rainbow-delimiters.nvim,HEAD, https://github.com/kien/rainbow_parentheses.vim/,, https://github.com/vim-scripts/random.vim/,, https://github.com/winston0410/range-highlight.nvim/,, +https://github.com/kelly-lin/ranger.nvim/,, https://github.com/rafaqz/ranger.vim/,, https://github.com/vim-scripts/rcshell.vim/,, https://github.com/ryvnf/readline.vim/,,