syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.9k forks source link

zz, zt, zb don't work in NeoTree #15355

Closed temporized-andy closed 2 years ago

temporized-andy commented 2 years ago

Could you please enable zz, zt, zb to position current line in NeoTree?

lebensterben commented 2 years ago

@temporized-andy Please follow the instructions in the issue template.

In particular, what's the expected behavior you want to achieve?

temporized-andy commented 2 years ago

@temporized-andy same functionality as in vim: zz - scroll current line the center zt - scroll current line to the top zb - scroll current line to the bottom

lebensterben commented 2 years ago

for zt and zb, you can use gg and G.

Alternatively, add the following to your user-config.

(evil-define-key 'evilified neotree-mode-map
  "zz" #'evil-scroll-line-to-center
  "zt" #'evil-scroll-line-to-top
  "zb" #'evil-scroll-line-to-bottom)
temporized-andy commented 2 years ago

Thank you so much! gg and G jump to the top/bottom which is slightly different but your snipped did exactly what I expected. It would be cool to have this out of the box like NerdTree.

lebensterben commented 2 years ago

We provide vim-inspired key bindings, which is gg and G.

But Neotree-style key bindings is not a design goal.

temporized-andy commented 2 years ago

@lebensterben I am sorry but these are not the Neotree keys these are vim keys. Neotree is just rendered inside a vim buffer and supports everything naturally. You can use the same key sequences anywhere in vim.

smile13241324 commented 2 years ago

Hmm sounds useful, I see what I can do

smile13241324 commented 2 years ago

I have added the vim bindings for zz, zt and zb. However other evio bindings like L are still missing as this tree is pretty old and brings its own set of keybindings.

For a full vim experience you should consider switching to the more modern treemacs package.

temporized-andy commented 2 years ago

@smile13241324 thank you so much!