kak-jj#
A plugin providing Jujutsu integration for Kakoune.
Installation#
kak-jj is quite simple to install.
- Clone this repository into your
pluginsdirectory. - Source the
rc/jj.kakfile in yourkakrc, or load it by any other method you want.
Usage#
kak-jj currently provides command integration and highlighting.
Command Integration#
Command integration allows you to execute Jujutsu commands directly from Kakoune, and is highly customisable.
To run a Jujutsu command, you can use the jj-run-command command. This
command accepts a single string argument containing the Jujutsu command
to execute. For example, to run jj status, you would use
jj-run-command status. The output of any Jujutsu commands is shown in
a buffer with the filetype jj-output.
kak-jj provides sevaral common Jujutsu commands directly as Kakoune commands.
Currently, these are jj-status and jj-log, but their code can easily
serve as a basic template for defining your own.
Options#
kak-jj exposes several options as part of command integration.
jj_output_readonly: a boolean value indicating whether thejj-outputbuffer is readonly. This defaults tofalse.jj_default_arguments: a string value containing default arguments to pass to Jujutsu. This defaults to--no-pager.
Color#
Kakoune cannot show color in Jujutsu output buffers by default. Since color is quite important, there is a solution for this.
The kak-ansi plugin provides ANSI color highlighting for Kakoune buffers.
After installing this plugin, you can quickly enable color integration for
jj-output buffers by adding a hook to your kakrc. For example:
hook global WinSetOption filetype=jj-output %{
ansi-render
ansi-enable
}
In addition to this, you may need to enable color output from Jujutsu,
as this is disabled by default when the output is piped. You can utilise
the jj_default_arguments option for this. For example, in your kakrc:
set-option global jj_default_arguments "--no-pager --config ui.color=always"
With this, you should be able to get color output.
Highlighting#
Highlighting is done on all .jjdescription files by default, and currently
supports a basic feature set including comments and status lines.