by TacticalCoder · 2y ago · 0 comments
ivy-avy works like vim's EasyMotion or the older Emacs "ace-jump" mode (inspired by EasyMotion): you keep your eyes on the thing you want to select (or the place on the screen where you want your cursor to go to) and then invoke avy (by using a shortcut very conveniently placed as I use it all the time). Then a letter appears and you hit that letter (requires to be a touch typist as you cannot both keep your eyes on the candidate and look at your keyboard) and boom, you just selected the candidate / moved the cursor.
There's no faster way to select / move anywhere on the screen.
I'm using that since years (I used to use ace-jump before ivy/avy was a thing).
Imagine this list of candidates after I asked to open a file containing the regexp "green" (well it's just a word, but it could be a regexp):
/home/jack/work/green.pdf
/home/jack/private/greendayschedule.org
.
. (omit 10 lines here)
.
/mnt/greenvelvet.txt
/mnt/backup/green.cfg
Now I invoke "ivy-avy" and the list of candidates becomes this: f/home/jack/work/green.pdf
g/home/jack/private/greendayschedule.org
n
b (omit 10 lines here)
c
e/mnt/greenvelvet.txt
d/mnt/backup/green.cfg
And these individual letters appear in another color, so they stand out.To select, say, "mnt/greenvelvet.txt", you just hit the letter 'e'. Done.
It's really sweet and it works with nearly everything: selecting a candidate in a list (like a file, a completion, ...), moving the cursor anywhere on the screen, selecting a buffer, etc.
> To select, say, "mnt/greenvelvet.txt", you just hit the letter 'e'. Done.
With helm+avy, I need to explicitly press Ctrl+Space to select. But, pressing 'e' does move the caret to the proper line containing '/mnt/greenvelvet.txt'
I coudnt find a helm counterpart to 'ivy-avy' package though.
---------------------------------------------------------
Edit:- avy-ivy, on pressing 'e' confirms greenvelvet.txt as the selection. It is the helm equivalent of C-n...C-n until reaching '/mnt/greenvelvet.txt' and pressing Return.
I was looking for someway to 'helm mark' the line containing '/mnt/greenvelvet.txt' using avy.
Yes it's exactly the same: I'm actually reusing the same shortcut for both. In a regular buffer I'm using precisely avy-goto-char-timer and in, say, "counsel-find-file" (which I use instead of "find-file"), that same shortcut calls the ivy-avy function.
Now I use ivy/counsel/swiper/avy but don't use helm so cannot help there.
P.S: and I confirm I just hit the letter and, say, the file immediately opens (I don't need to hit enter for example)