3 ms·
I use that too: ivy / counsel etc. Then to quickly select among the candidates and to not go "arrow down / arrow down / arrow down / arrow down / {tab,enter,wha
by TacticalCoder 3y ago
I use that too: ivy / counsel etc. Then to quickly select among the candidates and to not go "arrow down / arrow down / arrow down / arrow down / {tab,enter,whatever}" I use ivy-avy.
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.
- textread 3y agoIs this the equivalent to calling ~avy-goto-char-timer~ (from a keybinding) whenever inside Helm completion windows? > 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.
- TacticalCoder 3y ago> Is this the equivalent to calling ~avy-goto-char-timer~ (from a keybinding) whenever inside Helm completion windows? 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)
- textread 3y agoThanks a lot for teaching us a new avy trick today.
- lvass 3y agoThat does sound great, but to be fair most of the time, the helm equivalent is to type one or a few more characters of the one file name you want and press enter. Avy is a great tool, but in my experience using C-s actually requires fewers strokes than Avy over 90% of the time. Being limited to whatever is on screen tends to get very annoying, as is the mental load of pressing random characters instead of completing a word you already know. For me Avy shines for things like avy-copy-line that can prevent you from moving back and forth.