luukvbaal / nnn.nvim

File manager for Neovim powered by nnn.
BSD 3-Clause "New" or "Revised" License
422 stars 9 forks source link

Feature Request: Implement Split-Specific File Picker with Letter Designation #98

Open theTechGoose opened 4 months ago

theTechGoose commented 4 months ago

Description

I have been using NVChad, and I've noticed a particularly useful feature in its native file picker. When multiple splits are open, the file picker displays letters (A, B, C, D, etc.) at the bottom of each split. When selecting a file, you can choose the corresponding letter to open the file in that specific split.

Request

Is there a way to configure a similar feature in our setup? Specifically:

This feature would significantly enhance workflow efficiency by making file management in a multi-split environment more intuitive.

Thank you for considering this request!

image
luukvbaal commented 4 months ago

Possible sure, and a cool idea. But it might be a while before I get around to builtin support for this.

I think it's possible to add this yourself through a custom mapping.

theTechGoose commented 4 months ago

Thank you! Do you mind pointing me in the right direction? I have no idea where to even get started in doing something like this.

luukvbaal commented 4 months ago

Mappings get passed the file name upon selection. Inside the callback you would get all the windows in the current tabpage, add an indicator(looks like your screenshot uses the statusline but could also be a floating window), create temporary mappings with the used indicators that pass the window id, and then open the file in the selected window when one of the mappings is used.

theTechGoose commented 4 months ago

Thank you, I set up the implementation for myself; it was quite involved. Does this make it a little easier to integrate into the plugin, I already did most of the work. I'm just not familiar enough with lua to submit a PR.

https://github.com/theTechGoose/vim-window-selector