Skip to content

martinbaillie/evil-motion-trainer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

evil-motion-trainer

Evil Motion Trainer

About

You've already opted to give your Emacs setup a streak of modal editing malevolence, so why not train yourself to move around your Emacs evil buffer with all the grace and poise of advanced motions. We are not barbarians, after all.

Entering evil-motion-trainer-mode makes Emacs drop lazily repeated hjkl-based motions after a configurable threshold, forcing you to think about a more precise motion.

Why?

Simply put, these keys are not the best choice for the job in most cases. Word-wise motions (e.g. wW, bB, eE, ge), character searches (e.g. fF, tT, ,, ;) and line jumps (e.g. 10j 5k) will get you there with less keystrokes.

Configuration

Enable in a buffer with:

(evil-motion-trainer-mode)

Turn on for all buffers:

(global-evil-motion-trainer-mode 1)

Configure the number of permitted repeated key presses:

(setq evil-motion-trainer-threshold 6)

Enable a super annoying mode that pops a warning in a buffer:

(setq evil-motion-trainer-super-annoying-mode t)

Add to the suggested alternatives for a key:

(emt-add-suggestion 'evil-next-line 'evil-avy-goto-char-timer)
;; See also: (emt-add-suggestions)

References

This package borrows from and was inspired by:

  • Emacs annoying-arrows-mode
  • Emacs evil-annoying-arrows-mode
  • Vim hardtime
  • Vim hardmode