crazy-mode is a Rube Goldberg machine (but simpler and one that works) mode for GNU Emacs. crazy-mode helps you code/go crazy. Currently good support for C programming is included.
crazy-mode hacks around the characters as you type in the buffer to do various stuff often reducing the effort to accomplish something.
Say for example, in c-mode, pressing space bar often inserts
_ or sometimes
real spaces depending on the context. It also inserts
- when inside
If you find this software useful, you may:
- Help free software by switching to any GNU/Linux.
- Regardless of the Operating System you use, always buy
Debian main compatible hardware or at least ask for one.
- This can help free software, improve hardware lifetime and reduce Planned obsolescence.
Figure 1: crazy-mode demo
It's known that GNU Emacs is extremely extensible, and when I was first introduced to GNU Emacs, I decided to do something weird. I liked the idea of dwim which is very popular in the Emacs world, and I wanted to reduce as much keystrokes to write my code. I wrote some elisp hacks to do so, which worked really great.
Since I has been using this in my personal config for quite some time, I decided to write a mode for that which is more maintainable.
| in the examples is the cursor point. You can always do C-q key
when do you wan't crazy-mode to act crazy for the given key.
- S-SPC (shift + space)
- insert real space (may not work without a GUI)
- . key
- pressing space bar
->|(ie, pressing space bar twice gives
#include <example|>=> #include
- ' key
- , key
power = |
- ; key
power = pow(3, 4|)=>
power = pow(3, 4);
crazy-mode has been tested only with GNU Emacs 27.1 and 28
Installing from git
git clone https://gitlab.com/sadiq/crazy-mode.git emacs --batch --eval="(package-install-file \"$(realpath crazy-mode)\")"
;; set custom path if loading from custom path ;; (add-to-list 'load-path "~/.emacs.d/crazy-mode/") (require 'crazy) (add-hook 'c-mode-common-hook (lambda () ;; note: "gnu" (default) style adds a space before function '(' (add-to-list 'c-cleanup-list 'space-before-funcall) (c-toggle-auto-newline 1) (electric-pair-mode 1) (crazy-mode 1)))
Written in 2022 by Mohammed Sadiq <firstname.lastname@example.org>
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see the license online.