netrw.nvim icon indicating copy to clipboard operation
netrw.nvim copied to clipboard

Mapping to bd netrw

Open SlartThunder opened this issue 1 year ago • 1 comments

I'm trying to have a mapping so it will close the netrw and display again the buffer it was when netrw was opened. I'm using tpope/vim-vinegar plugin also, where in theory <Ctrl-6> should do the trick.

However, I found out some keybinding are clashing in my terminal, and I decided to implement the mapping with your plugin.

I have this configuration in my netrw setup:

return {
  "prichrd/netrw.nvim",
  config = function ()
    require("netrw").setup({
	  -- Put your configuration here, or leave the object empty to take the default
	  -- configuration.
	  icons = {
		symlink = '', -- Symlink icon (directory and file)
		directory = '', -- Directory icon
		file = '', -- File icon
	  },
	  use_devicons = true, -- Uses nvim-web-devicons if true, otherwise use the file icon specified above
	  mappings = {
	    -- Map Ctrl+6 to exit Netrw
	    -- ['<C-6>'] = ":bd<CR>",
	    ['<C-9>'] = ":Rexplore<CR>",
	  }, -- Custom key mappings
	})
  end,
}

Though it works, the behaviour it's kind of buggy not always closing as it is supposed to.

What's wrong?

SlartThunder avatar Oct 28 '24 21:10 SlartThunder

Hey @SlartThunder,

Thank you for raising this issue. The netrw.nvim plugin shouldn't interfere with the :Rexplore command, it only adds icons and key mappings. Are you seeing similar "buggy" behaviours without using your custom mapping, executing the :Rexplore command by itself?

prichrd avatar Jan 19 '25 23:01 prichrd