Scrolling downwards is overriden by keymap
itsramiel opened this issue · comments
Description
Hi,
I am used to scrolling upwards and downwards using and which are the default vim scrolling key bindings, but nvim-tree override so I can scroll up but not down :/
How can I keep all the other default mappings but disable or a specific nvim keymap?
Neovim version
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.9.5/share/nvim"
Operating system and version
Macos 14.3.1
Windows variant
No response
nvim-tree version
version 1.0.0, tag v1.0, commit d35a8d5
Clean room replication
Literally no customization
Steps to reproduce
- Toggle nvim tree in a long directory
- press and see how it doesnt scroll
Expected behavior
Would love it to scroll down when pressing
Actual behavior
No response
You can map all defaults and then remove / override individuals. See :help nvim-tree-mappings
I am used to scrolling upwards and downwards using and which are the default vim scrolling key bindings
Which bindings are these? ^F
^B
?
default keymaps to scroll:
<C-E>
to scroll down
<C-Y>
to scroll up
Here is the solution for now using the help:
local function my_on_attach(bufnr)
local api = require("nvim-tree.api")
api.config.mappings.default_on_attach(bufnr)
vim.keymap.del("n", "<C-E>", { buffer = bufnr })
end
-- configure nvim-tree
require("nvim-tree").setup({
on_attach = my_on_attach,
})
An audit of the default mappings that override vim defaults might be useful for troubleshooting wiki.