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

Suggestion for doc: combine evil-numbers and speeddating #14

Open
schoettl opened this issue Feb 14, 2020 · 0 comments
Open

Suggestion for doc: combine evil-numbers and speeddating #14

schoettl opened this issue Feb 14, 2020 · 0 comments

Comments

@schoettl
Copy link

Cool thing! Coming from vim, I'm used to having the functionality of evil-numbers and speeddating combined in one key mapping.

I achieved it like this:

(defun my-increment-at-pt nil
  "Increment number or date (speeddating) at point"
  (interactive)
  (condition-case nil
    (speeddating-increase 1)
    (error (evil-numbers/inc-at-pt 1))))
(defun my-decrease-at-pt nil
  "Decrease number or date (speeddating) at point"
  (interactive)
  (condition-case nil
    (speeddating-decrease 1)
    (error (evil-numbers/dec-at-pt 1))))
(evil-define-key 'normal 'global "C-c +" 'my-increment-at-pt)
(evil-define-key 'normal 'global "C-c -" 'my-decrease-at-pt)

Maybe you want to add the snippet to the README (or even integrate this combination in the source, if that dependency on speeddating makes sense?).

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

1 participant