Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goto Anything #134

Open
jncraton opened this issue Jan 13, 2018 · 4 comments
Open

Goto Anything #134

jncraton opened this issue Jan 13, 2018 · 4 comments

Comments

@jncraton
Copy link
Contributor

Is there interest in a simplified Goto Anything feature? This would make it much simpler to navigate inside files for me.

I'm aware of the goto line number issue. This would supersede that feature. It could work as follows:

  • Add a key binding to pop an overlay to enter a string. My suggestion is Ctrl+g in Emacs mode. Ctrl+p makes more sense, but it is already in use. Ctrl+g is often used as "Goto line number" in other editors.
  • The overlay would accept a string terminated by enter.
  • If the entered string can be parsed as an int, jump to that line number and exit the overlay.
  • Otherwise, jump to the next occurrence of that string in the file while keeping the overlay active. Pressing enter again jumps to the following occurrence of the search string, wrapping indefinitely. Any other key exits the overlay.
@gchp
Copy link
Owner

gchp commented Jan 13, 2018

That sounds good to me!

@gchp
Copy link
Owner

gchp commented Jan 13, 2018

Search is something I haven't even thought about yet, but if you have ideas I'd love to hear them.

@jncraton
Copy link
Contributor Author

Sounds good. I'm a little unclear what the overall UI vision for this project is, so I wasn't sure the best way to handle this sort of thing. It feels like a mix of Emacs, Vim, and modern GUIs right now. On the Vim side of things, I think it make sense to implement these common Vim commands as a start:

  • :{linenum}
  • \{needle}

On the default mode, Ctrl+g bound to a Goto Anything interface makes sense to me for now given the other keys that are already bound. Longer term, I think it makes sense to have a modern UI mode (Ctrl+f for find, Ctrl+d to duplicate a line, Ctrl+arrows for word movement, etc).

@gchp
Copy link
Owner

gchp commented Jan 14, 2018

Yeah, I would be happy to rename the current default keybinding mode to somethink like "emacs" mode. Then create a new default mode as you describe. So we'd then have optional vi and emacs modes which you could choose via a command line option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants