You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,6 +21,14 @@ or by installing `SPC` on your system.
21
21
SPC ff -r foo RET i -r "Hello World" ESC SPC fs RET
22
22
```
23
23
24
+
`SPC` expects an Emacs daemon to be already running and ready to receive keyboard macros.
25
+
You can start such a daemon manually within Emacs by executing `M-x server-start`.
26
+
Or by using a nixos or nix-darwin service that starts an emacs daemon.
27
+
28
+
There are many options that let you customize how `SPC` talks to your Emacs daemon.
29
+
Running `SPC --help` shows the command usage.
30
+
31
+
24
32
### Installing with NixOS or Home-Manager
25
33
26
34
This flake provides the SPC package that can be added to your environment packages.
@@ -35,7 +43,7 @@ home.packages = [
35
43
```
36
44
37
45
38
-
### Imperative Installation
46
+
### Nix Imperative Installation
39
47
40
48
Install `SPC` in your nix profile.
41
49
@@ -45,6 +53,10 @@ SPC --help
45
53
```
46
54
47
55
56
+
### Installing wihout Nix
57
+
58
+
Just download `bin/SPC`, it expects coreutils and emacs on PATH.
59
+
48
60
### Motivation
49
61
50
62
`SPC` was [born](https://github.com/vic/vix/blob/c55260f9591c7b243145fbbab37d68e775783a8d/vix/modules/vic/emacs/default.nix#L49) as an integration utility to make other applications interact with DOOM/Spacemacs by sending keystrokes.
@@ -66,164 +78,6 @@ just as if you would have typed it.
66
78
Some people might also want to create several command aliases to ease frequent use
67
79
cases. See the [Integrations] section.
68
80
69
-
70
-
### Manual Page
71
-
72
-
`SPC` expects an Emacs daemon to be already running and ready to receive keyboard macros.
73
-
You can start such a daemon manually within Emacs by executing `M-x server-start`.
74
-
Or by using a nixos or nix-darwin service that starts an emacs daemon.
75
-
76
-
There are many options that let you customize how `SPC` talks to your Emacs daemon.
77
-
Running `SPC --help` shows the command usage, included here for reference:
78
-
79
-
80
-
<!--BEGIN_HELP-->
81
-
82
-
```
83
-
SPC - Send a SPC keyboard macro to Spacemacs or DOOM Emacs via emacsclient.
84
-
85
-
USAGE
86
-
87
-
SPC [OPTION..] [KEYS..] [-- emacsclient options]
88
-
89
-
KEYS are key sequence strings in the format accepted by `(kbd)` and as
90
-
returned by commands such as `C-h k` in Emacs.
91
-
92
-
93
-
OPTIONS
94
-
95
-
-D, --describe
96
-
Causes emacs to print a brief description of the received
97
-
key sequence. This option is useful when debugging or
98
-
constructing your first keyboard macro.
99
-
100
-
-r, --raw <INPUT>
101
-
Sends INPUT as if it was directly typed on Emacs.
102
-
Since raw inputs can be any byte sequence they are encoded
103
-
using the `base64` command and decoded on the Emacs daemon.
104
-
105
-
This is useful for sending keys that otherwise would be
106
-
interpreted as options for SPC itself.
107
-
108
-
eg. `-r --lisp` will send `(kbd "- - l i s p")` to Emacs.
109
-
110
-
-f, --file-raw <FILE>
111
-
Sends all content from FILE as if directly typed on Emacs.
112
-
113
-
-f-, --stdin
114
-
Sends all content from STDIN as if directly typed on Emacs.
115
-
116
-
-l, --lisp <CODE>
117
-
Expects CODE to be an Emacs lisp expression that produces a
118
-
keycode vector.
119
-
120
-
eg. `-l '(kbd "M-x help RET")'`
121
-
122
-
-L, --leader <KEYS>
123
-
Use KEYS as leader at start of keyboard macro.
124
-
Defaults to `SPC` in Spacemacs and DOOM Emacs.
125
-
126
-
Can also be used to remove the leader, eg:
127
-
`SPC -L '' M-x doctor RET`
128
-
129
-
-W, --wrapper <WRAPPER>
130
-
Wrap the keyboard macro invocation inside custom lisp.
131
-
The WRAPPER code must include a `(SPC_MACRO)` lisp FORM
132
-
that will be replaced with the actual macro invocation.
133
-
134
-
This option allows you to eg, select a custom buffer or
135
-
doing anything special before/after the kbd macro is sent.
136
-
137
-
eg. `-W '(message "%s" (quote (SPC_MACRO)))'` will just echo
138
-
the generated code inside Emacs and actually do nothing.
139
-
140
-
-WPRINT
141
-
A predefined WRAPPER that prints the current buffer text.
142
-
143
-
eg. in DOOM Emacs the following command will print the ORG
144
-
agenda headlines matching "standup":
145
-
`SPC oAM standup RET -WPRINT`
146
-
147
-
148
-
149
-
-M, --macro-caller <MACRO_CALLER>
150
-
Custom Emacs lisp code that executes a keyboard macro.
151
-
The MACRO_CALLER code must include a `(SPC_KEYS)`
152
-
lisp FORM that will be replaced with the actual
153
-
keys vector.
154
-
155
-
By default it uses `(execute-kbd-macro (SPC_KEYS))`
156
-
but can be overriden to and not evaluate the keys at all.
157
-
158
-
eg. `-M '(key-description (SPC_KEYS))'` just prints the
159
-
keysequence that Emacs received.
160
-
161
-
--dry-run
162
-
Just print the emacsclient command that would be run.
163
-
164
-
-h, --help
165
-
Show this help and exit.
166
-
167
-
--
168
-
Stop parsing arguments.
169
-
All remaining arguments are given directly to the
170
-
emacsclient command.
171
-
172
-
173
-
174
-
ENVIRONMENT VARIABLES
175
-
176
-
SPC_LEADER The leader key used for sending keychords.
177
-
178
-
Defaults to `SPC` on both Spacemacs and DOOM Emacs.
179
-
180
-
SPC_WRAPPER Equivalent to always using a `--wrapper` option.
181
-
182
-
SPC_MACRO_CALLER Equivalent to always using a `--macro-caller` option.
183
-
184
-
SPC_CLIENT_CMD The command used to send emacslisp code.
185
-
It must at least support the `--eval LISP` option.
186
-
187
-
Defaults to `emacsclient`
188
-
189
-
SPC_CLIENT_OPTS Additional options for emacsclient.
190
-
See `emacsclient --help`.
191
-
192
-
For example, setting this to `--tty` will
193
-
tell emacsclient to always use the terminal UI.
194
-
195
-
EXAMPLES
196
-
197
-
# Describe what `SPC f f` does
198
-
SPC -D ff # => SPC f f runs the command counsel-find-file
0 commit comments