跳转到主内容

柔术

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

功能

在柔术仓库中时显示柔术信息。

示例配置

{
"type": "jujutsu",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#193549",
"background": "#ffeb3b",
"options": {
"fetch_status": true,
"ignore_working_copy": false,
"fetch_ahead_counter": true,
"ahead_icon": "⇡"
}
}

选项

信息获取

由于执行柔术(jj)调用可能降低提示符响应速度,默认不主动获取信息。 将 status_formats 设为 true 可启用额外信息获取(并填充模板)。

NameTypeDefaultDescription
change_id_min_lenint0ChangeID will be at least this many characters, even if a shorter one would be unique
fetch_statusbooleanfalsefetch the local changes
ignore_working_copybooleantruedon't snapshot/update the working copy
fetch_ahead_counterbooleanfalsefetch a counter for number of changes between working copy and closest bookmark
ahead_iconstring\u21e1icon/character between bookmark and ahead counter
native_fallbackbooleanfalsewhen set to true and jj.exe is not available when inside a WSL2 shared Windows drive, we will fallback to the native jj executable to fetch data. Not all information can be displayed in this case
status_formatsmap[string]stringa key, value map allowing to override how individual status items are displayed. For example, "status_formats": { "Added": "Added: %d" } will display the added count as Added: 1 instead of +1. See the Status section for available overrides

模板 (信息)

默认模板
 \uf1fa{{.ChangeID}}{{if .Working.Changed}} \uf044 {{ .Working.String }}{{ end }}

属性

NameTypeDescription
.WorkingStatuschanges in the working copy (see below)
.ChangeIDstringThe shortest unique prefix of the working copy change that's at least change_id_min_len long
.ClosestBookmarksstringClosest bookmark(s) on ancestors

状态标识

NameTypeDescription
.Modifiedintnumber of modified files
.Deletedintnumber of deleted files
.Addedintnumber of added files
.Movedintnumber of renamed files
.Changedbooleanif the status contains changes or not
.Stringstringa string representation of the changes above

本地变更使用以下语法表示:

IconDescription
~Modified
-Deleted
+Added
>Moved