Skip to content

Commit 6bfc972

Browse files
committed
Add jj item
1 parent 44c521a commit 6bfc972

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

functions/_tide_item_jj.fish

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
function _tide_item_jj
2+
if not command -sq jj; or not jj root --quiet &>/dev/null
3+
return 1
4+
end
5+
6+
set jj_status (jj log -r@ -n1 --no-graph --color always -T '
7+
separate(" ",
8+
bookmarks.map(|x| if(
9+
x.name().substr(0, 10).starts_with(x.name()),
10+
x.name().substr(0, 10),
11+
x.name().substr(0, 9) ++ "…")
12+
).join(" "),
13+
tags.map(|x| if(
14+
x.name().substr(0, 10).starts_with(x.name()),
15+
x.name().substr(0, 10),
16+
x.name().substr(0, 9) ++ "…")
17+
).join(" "),
18+
surround("\"","\"",
19+
if(
20+
description.first_line().substr(0, 24).starts_with(description.first_line()),
21+
description.first_line().substr(0, 24),
22+
description.first_line().substr(0, 23) ++ "…"
23+
)
24+
),
25+
change_id.shortest(),
26+
commit_id.shortest(),
27+
diff.files().len() ++ "m",
28+
diff.stat().total_added() ++ "+",
29+
diff.stat().total_removed() ++ "-",
30+
if(conflict, "conflict"),
31+
if(divergent, "divergent"),
32+
if(hidden, "hidden"),
33+
)' | string trim)
34+
_tide_print_item jj $tide_jj_icon' ' "($jj_status)"
35+
end

functions/_tide_remove_unusable_items.fish

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function _tide_remove_unusable_items
22
# Remove tool-specific items for tools the machine doesn't have installed
33
set -l removed_items
4-
for item in aws bun crystal direnv distrobox docker elixir gcloud git go java kubectl nix_shell node php pulumi python ruby rustc terraform toolbox zig
4+
for item in aws bun crystal direnv distrobox docker elixir jj gcloud git go java kubectl nix_shell node php pulumi python ruby rustc terraform toolbox zig
55
contains $item $tide_left_prompt_items $tide_right_prompt_items || continue
66

77
set -l cli_names $item

functions/tide/configure/configs/classic.fish

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ tide_jobs_number_threshold 1000
5252
tide_kubectl_bg_color 444444
5353
tide_kubectl_color 326CE5
5454
tide_left_prompt_frame_enabled true
55-
tide_left_prompt_items pwd git newline
55+
tide_left_prompt_items pwd git jj newline
5656
tide_left_prompt_prefix ''
5757
tide_left_prompt_separator_diff_color 
5858
tide_left_prompt_separator_same_color 
@@ -79,7 +79,7 @@ tide_pwd_bg_color 444444
7979
tide_pwd_color_anchors $_tide_color_light_blue
8080
tide_pwd_color_dirs $_tide_color_dark_blue
8181
tide_pwd_color_truncated_dirs 8787AF
82-
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform bun.lockb Cargo.toml composer.json CVS go.mod package.json build.zig
82+
tide_pwd_markers .bzr .citc .git .hg .jj .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform bun.lockb Cargo.toml composer.json CVS go.mod package.json build.zig
8383
tide_python_bg_color 444444
8484
tide_python_color 00AFAF
8585
tide_right_prompt_frame_enabled true

0 commit comments

Comments
 (0)