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

evil-digit-argument-or-evil-org-beginning-of-line is a function alias and I can't figure out how to make it a known command #118

Open
aaronjensen opened this issue May 1, 2021 · 4 comments

Comments

@aaronjensen
Copy link

when evil-org is used, evil-digit-argument-or-evil-org-beginning-of-line is a function alias for an anonymous lambda. When I attempt to add it to evil-mc-custom-known-commands, it doesn't appear to work. Is there another way to add it?

@aaronjensen
Copy link
Author

Here's my workaround for now:

(evil-define-motion org-beginning-of-line-or-digit-argument ()
    "Move the cursor to the beginning of the current line.
This function passes its command to `digit-argument' (usually a 0)
if it is not the first event."
    :type exclusive
    (cond
     (current-prefix-arg
      (setq this-command #'digit-argument)
      (call-interactively #'digit-argument))
     (t
      (setq this-command #'org-beginning-of-line)
      (call-interactively #'org-beginning-of-line))))

(evil-define-minor-mode-key 'motion 'evil-org-mode "0" #'org-beginning-of-line-or-digit-argument)

(add-to-list 'evil-mc-custom-known-commands
               '(org-beginning-of-line-or-digit-argument
                 (:default . evil-mc-execute-default-call)
                 (visual . evil-mc-execute-visual-call)))

@dschrempf
Copy link

dschrempf commented Feb 16, 2024

Maybe some things have changed in the meantime, but I managed to solve this problem using

  (add-to-list 'evil-mc-custom-known-commands
               '(evil-org-beginning-of-line . ((:default . evil-mc-execute-default-call-with-count)))

I think we could add this to the known commands of the package. (I think other evil-org bindings are included there already).

@aaronjensen
Copy link
Author

This doesn't work for me. Setting this up, then creating a text buffer in org-mode with:

foo
foo

And using evil-mc to create cursors on each foo (w/ the cursor at the end of the word) then pressing 0 only moves the first cursor to the beginning of the line

@dschrempf
Copy link

Interesting. It does work for me... Thanks for checking anyways!

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