blob: d1fe1354b5227eabbc5fe93ae6ee6b5fe43d8b64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# prelude.kak
Prelude of shell blocks for [Kakoune].
## Installation
Add [`prelude.kak`](rc/prelude.kak) to your autoload or source it manually.
``` kak
require-module prelude
```
## Usage
```
kak_escape [text…]
```
Similar to `shell_escape` you may find in other programming languages,
`kak_escape` escapes each argument so that it can be safely passed to Kakoune.
**Implementation**:
Single quotes each argument and doubles the single quotes inside.
**Note**:
The resulted text should be used unquoted and is not intended for use in double quotes, nor in single quotes.
**Example**:
``` kak
evaluate-commands %sh{
. "$kak_opt_prelude_path"
kak_escape evaluate-commands -try-client "$kak_client" 'echo Tchou' | kak -p "$kak_session"
}
```
[Kakoune]: https://kakoune.org
|