Mapping to bd netrw
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?
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?