kevinhwang91 / rnvimr

Make Ranger running in a floating window to communicate with Neovim via RPC
BSD 3-Clause "New" or "Revised" License
801 stars 19 forks source link

using lazy #157

Open iomari opened 5 months ago

iomari commented 5 months ago

can you show me the advanced config using lazy?

shiro commented 5 months ago

You can use mine as a reference, it gets lazy loaded once you hit the key-combo:

    {
        "kevinhwang91/rnvimr",
        keys = { { "<leader>l", "" } },
        init = function()
            vim.g.rnvimr_draw_border = 0
            vim.g.rnvimr_layout = {
                relative = "editor",
                width = vim.fn.winwidth(0),
                height = vim.fn.winheight(0) / 2,
                col = 0,
                row = vim.fn.winheight(0) / 4,
                style = "minimal",
            }
            vim.g.rnvimr_ranger_cmd = {
                "ranger",
                "--cmd=set preview_directories false",
                "--cmd=set column_ratios 2,5,0",
                "--cmd=set preview_files false",
                "--cmd=set preview_images truefalse",
                "--cmd=set padding_right false",
                "--cmd=set collapse_preview true",
            }
        end,
        config = function()
            vim.keymap.set("n", "<leader>l", function()
                vim.api.nvim_command("RnvimrToggle")
            end, {})
        end,
    },
ChrisTaylorDeveloper commented 3 months ago

This is my config:

  {
    'kevinhwang91/rnvimr',
    config = function()
      vim.keymap.set('n', '<leader>l', function()
        vim.api.nvim_command 'RnvimrToggle'
      end, {})
    end,
  },

Leader plus l opens ranger but when I press leader plus l again, nothing happens, the window does not hide. Any suggestions please? The space key seems to be captured by Ranger first i.e the cursor moves to the next line down.