Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: NERDTree Hijacked Movement Keys #1399

Closed
Swivelgames opened this issue Jan 8, 2024 · 6 comments · Fixed by #1400
Closed

BUG: NERDTree Hijacked Movement Keys #1399

Swivelgames opened this issue Jan 8, 2024 · 6 comments · Fixed by #1400
Labels

Comments

@Swivelgames
Copy link

A recent change in #1384 conflicts with a common navigation style for hopping up and down the buffer.

Reproduction Steps

  1. Open a large project in VIM
  2. Show NERDTree
  3. Attempt to navigate to the bottom of the buffer with L

Expected Behavior

Caret jumps to the bottom of NERDTree's buffer

Actual Behavior

NERDTree displays Number of Lines next to files


This breaks consistency among buffers, especially for something as fundamental as navigation.

@Swivelgames Swivelgames added the bug label Jan 8, 2024
@Swivelgames
Copy link
Author

This is pretty significant for me, personally, since I use a combination of H,M, or L and zt or zb for scrolling, along with the former for just basic buffer navigation.

This is equivalent to remapping h, j, k, or l

@Swivelgames Swivelgames changed the title BUG: NERDTree Hijacked Navigation BUG: NERDTree Hijacked Movement Keys Jan 8, 2024
@Swivelgames
Copy link
Author

Swivelgames commented Jan 8, 2024

Just saw @isaiah's comment on #1384 asking for the removal or change of this keybinding as well:

The keybinding override the navigation shortcut to move the cursor to the bottom, which is very important, is it possible to disable the keybinding?
https://github.com/preservim/nerdtree/pull/1384/files#diff-19392c14a742ab8948180b2b6a82e99321d1722b618ba00d3ac5dc805e8b0702R134

@rzvxa
Copy link
Member

rzvxa commented Jan 8, 2024

Hey, Thanks for reporting this issue.

For now, you can use the g:NERDTreeMapToggleFileLines variable to change it to something else so you can move on with your work until we change the default to prevent clashing with L binding.
Let me know if you have any good suggestions for this keybind, otherwise, I'm going to just use a 2 letter keybind as default.
I'm sorry for this inconvenience, I personally don't use H, L, or M in the context of NERDTree so I just didn't think about this. To be honest I just chose L without putting that much thought into it otherwise I would've averted this issue before it affected anyone.

@Swivelgames
Copy link
Author

Honestly, when I saw it, I figured that's what happened hahah. "L = Line Numbers" makes sense. I actually use H, M, and L subconsciously, so I wasn't even sure what happened until I tried to do it a second or third time. I was very confused 😅

@Swivelgames
Copy link
Author

Just updated, and it works beautifully! Thanks again!

@rzvxa
Copy link
Member

rzvxa commented Jan 9, 2024

@Swivelgames No worries mate, It was my pleasure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants