Repository navigation
How do I remap the n/N keys? #2055
|
When configuring neo-tree, I set the keybinds for "add" and "add new directory" in window = {
...
mappings = {
...
['n'] = 'add',
['N'] = 'add_directory'
}
}but when I press either key, it triggers the default vim "next/previous search item" bindings instead of the one I specified. I had this same setting working fine before, but I updated my version of neo-tree and switched to managing my Neovim packages with lazy.nvim from Packer and it stopped working. The "add/add new directory" functionality works as expected when I switch it back to the default |
Replies: 2 comments 1 reply
|
in lazy.nvim, specifying both config = function(_, opts)
nmap('<leader>\\', ':Neotree<CR>')
nmap('<leader>nt', ':Neotree<CR>')
nmap('<leader>cfg',
':tabnew<CR>:Neotree dir=' .. vim.fn.stdpath('config') .. '<CR>')
augroup('neo-tree', true, {{'VimEnter', '*', 'Neotree action=show'}})
-- add setup call
require("neo-tree").setup(opts)
-- (alternatively, just move opts into the setup call directly)
-- require("neo-tree").setup({ ... })
end, |

in lazy.nvim, specifying both
configandoptsmeans that you need to pass theoptsargument into neo-tree withinconfig, instead of having lazy.nvim automatically do it for you. change your config function to this: