Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/martinbaillie/evil-motion-trainer

Make Emacs drop lazily repeated "hjkl"-based motions after a configurable threshold
https://github.com/martinbaillie/evil-motion-trainer

emacs emacs-lisp evil-mode modal-editing

Last synced: 2 months ago
JSON representation

Make Emacs drop lazily repeated "hjkl"-based motions after a configurable threshold

Awesome Lists containing this project

README

        

# evil-motion-trainer

![Evil Motion Trainer](evil_motion_trainer.gif "Evil Motion Trainer")

## About

You've already opted to give your Emacs setup a streak of [modal
editing](https://github.com/emacs-evil/evil)
[malevolence](https://github.com/PythonNut/evil-easymotion), 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:

```emacs-lisp
(evil-motion-trainer-mode)
```

Turn on for all buffers:

```emacs-lisp
(global-evil-motion-trainer-mode 1)
```

Configure the number of permitted repeated key presses:

```emacs-lisp
(setq evil-motion-trainer-threshold 6)
```

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

```emacs-lisp
(setq evil-motion-trainer-super-annoying-mode t)
```

Add to the suggested alternatives for a key:

```emacs-lisp
(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