Skip to content
sucrecacao edited this page Oct 4, 2020 · 2 revisions

kak -p send the commands written on the standard input to session session_id

echo "set-option global tabstop 5" | kak -p $kak_session
echo "edit /path/to/file" | kak -p $kak_session
echo "source /path/to/plugin.kak" | kak -p $kak_session

It's important to notice that this only work for command executed at a global scope, meaning any command you can put on a kakrc file.

A command like execute-keys will only work in a client, since it involves client-specific functionality such as "insert mode". To use execute-keys with kak -p you need to call execute-keys with the -client or -buffer option.

  • execute-keys -client will execute the keys with the current $client state ( cursor position, mode etc...)
  • execute-keys -buffer will execute the keys as if you are opening the buffer for the first time. It is handy if you want to affect a buffer without affecting a particular client.

Example:

echo "execute-keys -buffer /path/to/file ihello" | kak -p $kak_session
echo "execute-keys -client $client ihello" | kak -p $kak_session

Clone this wiki locally