tamago324 / lir.nvim

Neovim file explorer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error using `nvim .` after disabling netrw

heygarrett opened this issue · comments

If I don't disable netrw it still opens instead of lir when I do nvim . but if I do disable netrw (as shown in my config below) I get the following error:

Error detected while processing VimEnter Autocommands for "*"..function <SNR>15_VimEnter[10]..<SNR>15_LocalBrowse:
line   32:
E117: Unknown function: netrw#LocalBrowseCheck
Press ENTER or type command to continue

Here's my lir config:

return {
	"tamago324/lir.nvim",
	config = function()
		local loaded, lir = pcall(require, "lir")
		if not loaded then return end

		vim.g.loaded_netrw = 1
		vim.g.loaded_netrwPlugin = 1

		local actions = require("lir.actions")
		lir.setup({
			show_hidden_files = true,
			mappings = {
				["<cr>"] = actions.edit,
				["-"] = actions.up,
				["d"] = actions.mkdir,
				["D"] = actions.wipeout,
				["%"] = actions.newfile,
				["R"] = function() actions.rename(false) end,
				["r"] = actions.reload,
			},
		})

		vim.api.nvim_create_user_command("Lir", function()
			local directory = vim.fn.expand("%:p:h")
			vim.cmd.edit({
				args = { directory },
			})
		end, {})
	end,
}

Edit: Here's the more verbose error from using nvim -V10nvim.log .:

Error detected while processing BufEnter Autocommands for "*":
E5108: Error executing lua Vim:E194: No alternate file name to substitute for '#'
stack traceback:
        [C]: in function 'expand'
        ...l/share/nvim/site/pack/packer/start/lir.nvim/lua/lir.lua:182: in function 'init'
        [string ":lua"]:1: in main chunk
Error detected while processing VimEnter Autocommands for "*"..function <SNR>23_VimEnter[10]..<SNR>23_LocalBrowse:
line   32:
E117: Unknown function: netrw#LocalBrowseCheck
Press ENTER or type command to continue

Thank you for reporting.

What version of Neovim?

Apologies! I'm no longer able to reproduce this issue after switching from packer.nvim to lazy.nvim. 😅

Understood!
Next time, if you have any more problems, please make them!