-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Replace ace-jump with avy #2574
Conversation
Nice ! The reason why I delay the usage of |
Yes, seems to work (for me, at least). It deletes the region between the original point to the beginning of the selected line. |
Excellent 👍 |
Excellent work 👍! This wasn't possible with ace-jump either, but maybe someone knows a fix. I would like to select a range of lines in To reproduce:
I can also reproduce with the other avy-commands and a host of other non-evil commands as well. Where should we fix this? I don't quite understand the evil-visual-state code, but it's very strange that the normal visual state and even visual block state works with avy, but not the visual line state. |
This works fine using ace-jump. I don't think I have any special compat code other than what evil itself ships with. I do |
@myrjola this code seems to let you do with avy what @expez describes with ace-jump. I copied it from the definition of (evil-define-motion evil-avy-goto-line (count)
"Jump visually to the beginning of a line using avy."
:type line
:repeat abort
(evil-without-repeat
(call-interactively 'avy-goto-line)))
(define-key evil-visual-state-map (kbd "C-SPC") 'evil-avy-goto-line) I guess fully integrating evil and avy requires some work, but my evil-fu isn't strong enough for it. |
@bmag Many thanks! Your integration code works perfectly! Hopefully your PR will be accepted. Looking forward for this PR to be merged as well. |
Seems to be merged upstream, nice work @bmag 👍 I'm going to merge this PR soon. |
Thank you 👍 👍 👍 |
Related issue: #1354 @TheBB suggested to do a PR to get things in motion.
I've made the necessary changes to replace ace-jump with avy. Below is a summary.
SPC SPC is bound to
avy-goto-word-or-subword-1
(wasevil-ace-jump-word-mode
)SPC l is bound to
avy-goto-line
(wasevil-ace-jump-line-mode
)SPC
</kbd> is bound to
avy-pop-mark(was
ace-jump-mode-pop-mark`)I set
avy-keys
to use the same keys asace-jump
(a-z
) when selecting candidates. It might bebetter UI to use
avy
's default keys (asdfghjkl
).I set
avy
to allow jumping to other windows and frames, as mentioned in #1534 (comment)I didn't add
avy
faces to any themes, despite it being suggested in #1534 (comment).avy-pop-mark
is actuallypop-to-mark-command
in disguise, and it doesn't work as well asace-jump-mode-pop-mark
- it doesn't jump back across windows. I'll report an issue upstream and hopefully it will be improved. (EDIT: issue opened at abo-abo/avy#88)I decided not to trigger
golden-ratio
after jumping, because I found it annoying. If there isinterest in it, the relevant commands can be added to
golden-ratio-extra-commands
.I haven't touched the docs yet.