-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Feature Idea: Forward and backward versions #148
Comments
I don't fully understand. Please give a simple example. |
In vim, f and F are find char forward and backward in a line. I'd like to have something similar for finding characters forward and backward using avy (not restricted to a line) that I can bind in evil's normal mode. I saw that you can jump to lines above and below but I didn't see anything similar for characters. Does that make sense? |
Sounds to me like:
and
I think adding the above two as commands would only confuse the users. And having them as functions doesn't really serve a purpose. In any case, try to implement what you have in mind. I'll try to accommodate what changes in avy.el your package would need. |
Sorry, I thought it was clear, but I don't think I explained it well and I don't know the avy code well enough right now to give code. Say that you're in a buffer like this
where What I'm trying to say is that I almost always know ahead of time where the character I want to jump to is in relation to my cursor and it would be convenient if I could communicate that to avy through the command. If it's ahead of my cursor in the buffer and there is a lot of text on my screen then attaching overlays to the possibilities behind my cursor in the buffer is wasteful in some sense, and it would be more efficient if the overlays could be restricted to text after the point. I'm pretty sure that's not what you were suggesting with those examples. |
OK, I understand now. It's exactly the same as Here's an implementation: (defun avy-goto-char-below (char &optional arg)
"Jump to the currently visible CHAR.
The window scope is determined by `avy-all-windows' (ARG negates it)."
(interactive (list (read-char "char: " t)
current-prefix-arg))
(avy-with avy-goto-char
(avy--generic-jump
(if (= 13 char)
"\n"
(regexp-quote (string char)))
arg
avy-style
(point)
(window-end (selected-window) t)))) You can compare it to |
Cool thanks and sorry for the confusion. |
avy.el (avy-goto-char-2-below): Add These are versions of avy-goto-char-2 that are restricted to matches before or after the point in the current window. Fixes abo-abo#148
I was wondering if you thought it would be useful to create forward and backward versions of some of the avy commands. The idea would be if I see a character ahead of my cursor I can cut down on the number of possibilities by roughly half using
avy-forward-char
(or something like that). It seems natural since most people are used to forward and backward search.The text was updated successfully, but these errors were encountered: