Example
kak -c kanto -client main file.txt +25:1
This feature would be useful for [connect.kak] to avoid parsing the arg-list (see [:edit]) and for setting the EDITOR environment variable.
EDITOR='kak -c kanto -client main'
Related issues:
Why not use printf 'eval -try-client main "edit file.txt 25 1" | kak -p kanto? It doesn't look like a new CLI flag is necessary.
I imagine one issue is that piping to kak -p does not lend itself very well to setting EDITOR.
I am not keen to add -client but I think we could have nice alternative to kak -p, say kak -P (not necessarily the actual switch) that would forward its shell arguments as kakoune commands.
kak -P kanto -- eval -try-client main edit file.txt 25 1 would be equivalent to piping. This would also save one fork for the usual case (by avoiding the pipe) and make it easier to forward shell variables (as there is no need to kak-quote them).
edit is not compatible with EDITOR, as the command edits a single file and have a different syntax for setting the cursor position.
I noticed we have to expand each file to their absolute path to ensure Kakoune will open the correct files. It does matter when the server directory differs from the directory where we run the command.
Most helpful comment
I imagine one issue is that piping to
kak -pdoes not lend itself very well to setting EDITOR.I am not keen to add
-clientbut I think we could have nice alternative tokak -p, saykak -P(not necessarily the actual switch) that would forward its shell arguments as kakoune commands.kak -P kanto -- eval -try-client main edit file.txt 25 1would be equivalent to piping. This would also save one fork for the usual case (by avoiding the pipe) and make it easier to forward shell variables (as there is no need to kak-quote them).