nvim-tree / nvim-tree.lua

A file explorer tree for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mappings/functionality discoverability discussion

gegoune opened this issue · comments

Since you touched on a topic of keybindings, currently it's hard to get a sense of what's possible.

  1. The help panel is hidden under "g?" keybinding by default, and only when nvim-tree updated its way to change keybindings, I discovered that there's a help panel (I was smashing ? and since it did nothing, I just assumed there's no help panel).
  2. As a user, you think everything useful (or even possible) is in this panel.

So I think the ideal solution would be to:

  1. Make it clear that g? is a default help panel keybinding. Show "g? - help" somewhere in nvim-tree panel or make it visible in readme.
  2. Show every possible API command in this help panel, even if it has no keybinding + keybinding if there's one
  3. Since there are lots of commands, it would be great to group them

This way, you can have minimal keybinding config and it will be extremely easy to copy-paste api function to your on_attach without reading :h nvim-tree

Originally posted by @DeH4er in #2706 (comment)

Let's discuss it here, to keep linked PR clean.

I think issue here is of a documentation rather than anything else.
Being an Neovim plugin and having the same target audience I am pretty happy to assume certain level of IT-related knowledge, mainly ability to find and read documentation.

It's true. My point is to make it easier to see all useful features to set/change a keybinding. Setting/changing a keybinding is probably one of the most common config changes people would make.

I doubt that someone will ever notice that they can use toggle_enable_filters or any other API feature which currently has no keybinding

And since there's already a help panel, why not make it better?

Here's what comes to mind

nvim-tree mappings                   exit: q


Navigation
  not assigned  Next Sibling         api.node.navigate.sibling.next
  <             Previous Sibling     api.node.navigate.sibling.prev
...

Files
  d             Delete               api.fs.remove
...

I am not agains showing all available api calls in help window. If grouped together, as you showed above, it's actually quite nice and useful.

I would not really like any statement regarding existance of g? in nvim-tree's window, because next person will want an option to remove it (that person could as well be me) and we will have to yet another option. We can improve documentation/readme to make it more obvious though.

Yeah, I would definitely disable g? - help line in config since it clutters the view. The idea is to get this knowledge somehow to the person who installs nvim-tree for the first time. One crazy idea is to name the buffer "g? - help" but it's super hacky and just asks for trouble

I am not agains showing all available api calls in help window. If grouped together, as you showed above, it's actually quite nice and useful.

Yes please - it could be another s toggle or two.

I would not really like any statement regarding existance of g? in nvim-tree's window, because next person will want an option to remove it (that person could as well be me) and we will have to yet another option. We can improve documentation/readme to make it more obvious though.

Yes. Users tend to get upset about that sort of thing.

The key is noted in help nvim-tree-quickstart-help nvim-tree-mappings nvim-tree-mappings-default and Readme Quick Start Help

If there was some way of showing it the first time the user runs the tree I would be very happy, however it's hard to persist any sort of state and... once again... users tend to get upset about that.

  1. The help panel is hidden under "g?" keybinding by default, and only when nvim-tree updated its way to change keybindings, I discovered that there's a help panel (I was smashing ? and since it did nothing, I just assumed there's no help panel).

The first thing I did when I started to use nvim-tree was bind ? to help.

There's not much consistency among plugins - some use g? some use ? some use both.

Could we add ? @gegoune ?

One thing I've always wanted (out of scope here) is the ability to press <CR> on the focused entry in help to execute it.

All the rest? Yes please!

One thing I've always wanted (out of scope here) is the ability to press <CR> on the focused entry in help to execute it.

Good idea!
And some other key to open help for it?

Could we add ?

This is default mapping (search backwards), hence g? became popular. Probably wouldn't want to go this way.

This is default mapping (search backwards), hence g? became popular. Probably wouldn't want to go this way.

Fair enough. I don't think we can really add anything further around discovery.