arrow.nvim icon indicating copy to clipboard operation
arrow.nvim copied to clipboard

feat: allow letters/symbols along with numbers to be used for jumping to files

Open tingey21 opened this issue 1 year ago • 10 comments

Hey @otavioschwanck , Just wanted to run an idea by you for my tiny 34-key split keyboard setup that I want to implement. Since I'm using layers for both the leader key and numbers, I thought it might be cool to have an option to add letters or symbols to our numbered files. Here's what I'm thinking: I wanted to add an optional param to let us record a letter or symbol along with the default number? It'd be totally opt-in, so it wouldn't mess with how things work now. We could have stuff like: 1 (a). internal/org/service.go 2 ($). internal/org/repo.go

I was thinking after the "Save File" prompt, we could have a quick window pop up where you can add a symbol/letter if you want. Just hit enter to skip it if you don't need one and we would keep settings key protected if the user opts in to mnemonic filing

let me know and I'll get to work 👀

tingey21 avatar Jul 10 '24 17:07 tingey21

I will try to do this over the weekend

otavioschwanck avatar Jul 12 '24 13:07 otavioschwanck

oh no worries I've been working on implementation I just wanted to see if you we're okay with the idea!

tingey21 avatar Jul 12 '24 13:07 tingey21

oh no worries I've been working on implementation I just wanted to see if you we're okay with the idea!

awesome!

i loved the idea

otavioschwanck avatar Jul 12 '24 13:07 otavioschwanck

Originally, I wanted to create a plugin for quickly jumping between buffers. My idea was to jump to the desired buffer with just two key presses (one key press for a pop-up, and another to jump to the buffer). However, I found this project that almost meets my needs.

Here’s my specific design:

  • Display buffers in the order of the jumplist, with selectable keys in front (preferably using easily accessible keys, e.g., fdsa, jkl).
  • Display the buffer's path relative to the current project directory, rather than the current directory. Though I generally like to set Neovim’s current directory to the project directory.
  • On the right side of the buffer path, show the function most recently edited or located in that buffer, along with the line number.

What do you think of the above features? Do you think they are feasible? If it can be achieved, I would really love this plugin.

JohanChane avatar Jul 16 '24 08:07 JohanChane

On the right side of the buffer path, show the function most recently edited or located in that buffer, along with the line number.

That's good idea

xzbdmw avatar Jul 21 '24 04:07 xzbdmw

I'm back I had some massive Projects to do at work that sunk all my time. I've added logging and tests to this as well to help with development I should have this wrapped up today or tomorrow 👀

tingey21 avatar Oct 20 '24 18:10 tingey21

Hello @tingey21, I was going to open an issue regarding the option to use letters instead of numbers for buffer-local or file bookmarks, then I saw this issue.

I believe that asking the user for input after bookmarking a file or position introduces unnecessary friction. It would be ideal if users could opt into this feature through a configuration option. For example, they could set the number of keys, like: letters = "asdf" , (I choose those letters personally since they’re on the same row), but users could customize them as they prefer, removing the need to display numbers or asking for additional input.

One plugin that does this really well for buffers is snipe.nvim, and I think we could benefit from a similar approach.

bassamsdata avatar Oct 21 '24 14:10 bassamsdata

@bassamsdata there is a config option index_keys does this.

xzbdmw avatar Oct 21 '24 14:10 xzbdmw

@xzbdmw Oh wow, I overlooked it, and this is working amazingly. Thank you!

bassamsdata avatar Oct 21 '24 15:10 bassamsdata

Is there any updates on the progress of this feature?

suzhiking avatar Dec 01 '24 08:12 suzhiking