1 # mg -- micro emacs
3 mg is an Emacs clone. Well, it's more minimal, it doesn't have any
4 scripting language etc, but it has mostly the same keybindings as Emacs.
5 Having it in base on OpenBSD is a Godsent.
7 set-fill-column 72
8 meta-key-mode
10 Set some defaults. `meta-key-mode' in particular is incredibly helpful
11 because it allows to enter non-ASCII characters. mg still doesn't know
12 how to render those (so you get "\303\250" instead of รจ), but at least
13 you can input them!
15 backup-to-home-directory
17 I don't like to have the whole filesystem dirtied by all those backup
18 files. This moves them in ~/.mg.d in case I need them.
20 define-key compile "n" next-line
21 define-key compile "p" previous-line
22 define-key compile "q" delete-window
24 Mg doesn't have many (any?) keybindings defined in compile-mode. This
25 turns it into something that resambles Emacs a bit more and it's
26 handier.
28 global-set-key "\^cm" compile
29 global-set-key "\eg\eg" goto-line
31 compile is handy to have and while here bind "M-g M-g" to goto-line,
32 just as in Emacs.
34 global-set-key "\eZ" zap-up-to-char
36 Handier than zap-to-char (M-z) most of the times.
38 auto-execute * electric-pair-mode
40 Something I'm working on...
42 auto-execute *.[ch] c-mode
43 auto-execute *.[ch] auto-fill-mode
45 auto-execute README* auto-fill-mode
46 auto-execute *.txt auto-fill-mode
47 auto-execute *.md auto-fill-mode
48 auto-execute *.[1-9] auto-fill-mode
50 auto-execute * auto-indent-mode
52 `auto-execute' is similar to add-hook. Set some default stuff for files
53 matching those patterns.