home/doc/pages/execeval.asciidoc
Maxime Coste 4fabba3d12 doc.kak: Render documentation internally instead of relying on man
doc.kak now behaves as a basic asciidoc renderer. Asciidoc is unfortunately
still a dependency to generate the manpage of the `kak` command.
2017-11-02 10:03:24 +08:00

57 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

= Exec and Eval
== Description
The *exec* and *eval* commands can be used to run Kakoune commands, and
should be used as follows:
----------------------------
exec [<flags>] <key> ...
eval [<flags>] <command> ...
----------------------------
*exec* runs keys as if they were pressed, whereas *eval* executes its given
parameters as if they were entered in the command prompt. By default, their
execution happens within the context of the current client, and stops when
the last key/command is reached, or an error is raised.
These two commands also save the following registers, who are then restored
when the commands have been executed: */*, *"*, *|*, *^*, *@*.
== Optional flags
*-client* <name>::
execute in the context of the client named *name*
*-try-client* <name>::
execute in the context of the client named *name* if such client
exists, or else in the current context
*-draft*::
execute in a copy of the context of the selected client. Modifications
to the selections or input state will not affect the client. This
permits to make some modification to the buffer without modifying
the users selection
*-itersel*::
execute once per selection, in a context with only the considered
selection. This permits avoiding cases where the selections may
get merged
*-buffer* <names>::
execute in the context of each buffers in the comma separated list
*names*, as a name can be used to iterate on all buffers
*-no-hooks*::
disable hook execution while executing the keys/commands
*-with-maps*::
use user key mapping in instead of built in keys (*exec* only)
*-save-regs* <regs>::
regs is a string of registers to be restored after execution (overwrites
the list of registers saved by default, c.f. description)
*-collapse-jumps*::
collapse all jumps into a single one from initial selection