Emacs and Unicode Commands
Agdapad
Agdapad
uses emacs
but not doom emacs
,
so only the agda
shortcuts (below) are relevant.
Notation
SPC
means space barC-x
meansCtrl-x
M-x
meansAlt-x
for non-Macs andOption-x
for MacsS-x
meansShift-x
RET
means enter
Example: C-c C-l
in Agda files is Ctrl-c
, let go, Ctrl-l
.
For the input of unicode characters go to the end of this page or visit
this site <https://agda.readthedocs.io/en/latest/tools/emacs-mode.html#keybindings>.
General Doom Emacs usage
The ‘ambient mode’ is called evil mode and follows vim-like bindings. The following commands are for evil mode:
SPC h b b
to look for bindings (keyboard shortcuts)SPC f f
to find files. can useTAB
for auto-completing paths andBackspace
to go up a directoryh j k l
for left down up rightSPC b k
to kill ‘buffers’ (any little window is a buffer). In generalSPC b
gives you many options for buffers.SPC w k
to kill unwanted windows (emacs can get split up into many windows) In generalSPC w
gives you many options for windows.i
to go into insert mode (in insert mode you can insert text) andESC
orC-g
to go back to evil mode.C-_
to undo (be careful with this, undo can go too far; going into and out of insert mode is considered “one change” in evil mode, so undoing might undo a lot of changes made in insert mode).r
to redo (be careful with this, redo can go too far).SPC h '
to look up how to write a symbol. (Put your cursor on the symbol first.)
Agda usage
Important
To insert text in the agda
file use i
to enter insert mode.
To escape insert mode do ESC
or C-g
.
All the commands below should be done whilst in insert mode.
Load :
C-c C-l
loads the fileCheck the goal :
C-c C-,
checks goal of the hole your cursor is in.Fill the goal :
C-c C-SPC
fills hole your cursor is in.Refine the goal :
C-c C-r
refines the hole your cursor is in.Case on
x
:C-c C-c
does cases onx
, wherex
is in the hole your cursor is in.Deduce :
C-c C-d
asks you to give it term / pointx
, it deduces the type / space thatx
belongs toNormalise :
C-c C-n
asks you to give it term / pointx
, it ‘reduces’x
to its ‘simplest (normalised) form’Combo :
C-c C-.
doesC-c C-,
andC-c C-d
Looking up definitions : in
agdapad
, clicking on something with the wheel of your mouse looks up the definitions of that thing (try clicking onType
for example). Indoom emacs
,M-SPC c d
looks up the definition of the thing you are hovering over.
You can find more commands for agda
in emacs
here.
Unicode commands
In general follow the guidance given above to learn unicode commands. However here are some commonly used ones to get you started
insert
\to
for→
insert
\==
for≡
insert
\==n
for≢
insert
\bot
for⊥
insert
\top
for⊤
insert
\neg
for¬
insert
\GS
or\Sigma
forΣ
insert
\cong
for≅
insert
\^
for superscript, e.g.S\^1
forS¹
insert
\bN
forℕ
and\bZ
forℤ
insert
\.
for∙
insert
\sqcup
for⊔
You can find more common symbols here.