neo-tree.nvim icon indicating copy to clipboard operation
neo-tree.nvim copied to clipboard

FEATURE: Find nodes and jump to it

Open s1n7ax opened this issue 1 year ago • 4 comments

Did you check the docs?

  • [X] I have read all the docs.

Is your feature request related to a problem? Please describe.

Right now following functions can be used to search nodes.

fuzzy_finder
fuzzy_finder_directory
filter_on_submit

However, none of them jumps to the node. As far as I know, there is no option to jump to the next and prev matches either. This takes extra key presses to navigate to the node.

Describe the solution you'd like.

I would expect it to work as Neovim native search.

  • Run find command
  • Enter the search query
    • As i'm typing the results will be highlighted.
    • Matches inside collapsed folder works similar to collapsed fold
      • If the first match is inside a collapsed folder, folder will be expanded and node will be highlighted
      • If the first match is visible, text will be highlighted
  • Hit enter to submit the query
    • Cursor will be navigated to the first matched node on enter
  • User can execute next_match or prev_match to jump to the node
    • On jump, if the node is inside a collapsed folder, folder/s will be expanded

Describe alternatives you've considered.

No response

Additional Context

No response

s1n7ax avatar Sep 08 '23 18:09 s1n7ax

Moving from preservim/nerdtree to nvim-neo-tree/neo-tree unfortunately lost this basic functionality mentioned above.

The fuzzy_finder* and filter_on_submit functions appear to work but provide a frustrating and broken experience out-of-the-box compared to the simplicity of typing / in a NERDTree file explorer window.

Plugins that change/overwrite how Neovim native (search) functionality works raises barrier to entry for having a good time with the plugin.

I appreciate how Neotree offers a floating filesystem feature, that has been enjoyable to use daily. However, the search experience with Neotree's current / has only added friction in the text editing workflow.

Using :/ in the Neotree window bypasses this issue and provides the desired functionality. However, it also defies years of existing muscle memory, decreasing mental flowstate.

chrisisler avatar Oct 30 '23 18:10 chrisisler

@chrisisler Many people (myself included) change the default mapping so that / goes back to the native search. This specific use case is right in the help file:

https://github.com/nvim-neo-tree/neo-tree.nvim/blob/936b029e514adc1fa7ab51c6c1a8a2c872a58797/doc/neo-tree.txt#L461-L477

cseickel avatar Oct 30 '23 23:10 cseickel

@cseickel Installing a plugin + writing more code to achieve native functionality = I'm uninstalling this.

Going back to NERDTree or nvim-telescope/telescope-file-browser.nvim.

The default experience for moving a file via neo-tree also does not provide expected mv behavior.

chrisisler avatar Oct 31 '23 00:10 chrisisler

@cseickel Installing a plugin + writing more code to achieve native functionality = I'm uninstalling this.

Going back to NERDTree or nvim-telescope/telescope-file-browser.nvim.

The default experience for moving a file via neo-tree also does not provide expected mv behavior.

I do have to agree, I find the default frustrating too. That said, neo-tree is used by tons of people and thus we cannot just change the default "because". Someone will complain that we broke their spacebar heating

workflow_2x.png

Thus the workaround that was provided is probably our best option here.

miversen33 avatar Nov 17 '23 13:11 miversen33

These are the default keybinds.

https://github.com/nvim-neo-tree/neo-tree.nvim/blob/5bde916c3f08487b7988893bfaa08dff69124405/lua/neo-tree/defaults.lua#L434-L439

If you cannot see where the cursor is, please turn on :h 'cursorline' in neo-tree window.

pysan3 avatar Mar 12 '24 12:03 pysan3