This commit is contained in:
Tao Tien 2025-02-27 00:23:32 -08:00
parent 83621c55db
commit 4b71f83dd2
3 changed files with 27 additions and 78 deletions

View file

@ -164,7 +164,7 @@ $env.config = {
buffer_editor: null # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL buffer_editor: null # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
use_ansi_coloring: true use_ansi_coloring: true
bracketed_paste: true # enable bracketed paste, currently useless on windows bracketed_paste: true # enable bracketed paste, currently useless on windows
edit_mode: vi # emacs, vi edit_mode: emacs # emacs, vi
shell_integration: { shell_integration: {
# osc2 abbreviates the path if in the home_dir, sets the tab/window title, shows the running command in the tab/window title # osc2 abbreviates the path if in the home_dir, sets the tab/window title, shows the running command in the tab/window title
osc2: true osc2: true

View file

@ -31,7 +31,7 @@ alias jp = jj git push
alias js = jj status alias js = jj status
alias jw = jj workspace update-stale alias jw = jj workspace update-stale
def jm [] { def jm [...rest] {
jj bookmark set main jj bookmark set main ...$rest
jj git push jj git push
} }

View file

@ -3,26 +3,26 @@
format = """ format = """
[](color_orange)\ [](color_orange)\
$username\ $username\
[](bg:color_yellow fg:color_orange)\ [](bg:color_yellow fg:color_orange)\
$directory\ $directory\
[](fg:color_yellow bg:color_aqua)\ [](fg:color_yellow bg:color_aqua)\
$jj\ ${custom.jj}\
$git_branch\
$git_status\
[](fg:color_aqua bg:color_blue)\ [](fg:color_aqua bg:color_blue)\
$c\
$rust\ $rust\
$python\
[](fg:color_blue bg:color_bg3)\ [](fg:color_blue bg:color_bg3)\
$docker_context\ $battery\
$conda\
[](fg:color_bg3 bg:color_bg1)\ [](fg:color_bg3 bg:color_bg1)\
$time\ $time\
[ ](fg:color_bg1)\ [ ](fg:color_bg1)\
$line_break$character""" $line_break$character"""
palette = 'gruvbox_dark' palette = 'gruvbox_dark'
[palettes.gruvbox_dark] [palettes.gruvbox_dark]
color_fg0 = '#fbf1c7' color_fg0 = '#fbf1c7'
color_bg1 = '#3c3836' color_bg1 = '#3c3836'
@ -35,12 +35,6 @@ color_purple = '#b16286'
color_red = '#cc241d' color_red = '#cc241d'
color_yellow = '#d79921' color_yellow = '#d79921'
# [username]
# show_always = true
# style_user = "bg:color_orange fg:color_fg0"
# style_root = "bg:color_orange fg:color_fg0"
# format = '[ $user ]($style)'
[directory] [directory]
style = "fg:color_fg0 bg:color_yellow" style = "fg:color_fg0 bg:color_yellow"
format = "[ $path ]($style)" format = "[ $path ]($style)"
@ -53,49 +47,10 @@ truncation_symbol = "…/"
"music" = "󰝚 " "music" = "󰝚 "
"pictures" = " " "pictures" = " "
# [git_branch]
# symbol = ""
# style = "bg:color_aqua"
# format = '[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)'
# [git_status]
# style = "bg:color_aqua"
# format = '[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)'
[nodejs]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[c]
symbol = " "
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[rust] [rust]
symbol = "" # # symbol = ""
style = "bg:color_blue" style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' format = '[[ $symbol($version) ](fg:color_fg0 bg:color_blue)]($style)'
[golang]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[java]
symbol = " "
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[kotlin]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[python]
symbol = ""
style = "bg:color_blue"
format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)'
[time] [time]
disabled = false disabled = false
@ -115,20 +70,18 @@ vimcmd_replace_one_symbol = '[](bold fg:color_purple)'
vimcmd_replace_symbol = '[](bold fg:color_purple)' vimcmd_replace_symbol = '[](bold fg:color_purple)'
vimcmd_visual_symbol = '[](bold fg:color_yellow)' vimcmd_visual_symbol = '[](bold fg:color_yellow)'
# [[battery.display]]
# threshold = 42
# custom module for jj status # custom module for jj status
[custom.jj] [custom.jj]
ignore_timeout = true ignore_timeout = true
description = "current jj status" description = "current jj status"
symbol = "" symbol = " 🥋 "
when = true when = "exit ((jj root | complete).exit_code)"
style = "bg:color_aqua"
command = ''' command = '''
if ((jj root | complete).exit_code == 0) {jj log --no-pager --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template ' jj log --no-pager --revisions @ --no-graph --ignore-working-copy --template '
separate(" ", separate(
"🥋", " ",
change_id.shortest(4), change_id.shortest(),
bookmarks, bookmarks,
"|", "|",
concat( concat(
@ -137,18 +90,20 @@ if ((jj root | complete).exit_code == 0) {jj log --no-pager --revisions @ --no-g
if(hidden, "👻"), if(hidden, "👻"),
if(immutable, "🔒"), if(immutable, "🔒"),
), ),
raw_escape_sequence("\x1b[1;32m") ++ if(empty, "(empty)"), if(empty,
raw_escape_sequence("\x1b[1;32m") ++ if(description.first_line().len() == 0, "(empty)"
),
if(description.first_line().len() == 0,
"(no description set)", "(no description set)",
if(description.first_line().substr(0, 29) == description.first_line(), if(description.first_line().substr(0, 29) == description.first_line(),
description.first_line(), description.first_line(),
description.first_line().substr(0, 29) ++ "...", description.first_line().substr(0, 29) ++ "...",
) )
) ++ raw_escape_sequence("\x1b[0m"), ),
) )
'} '
''' '''
shell = ["nu", "-c"]
# disable git modules # disable git modules
[git_state] [git_state]
@ -162,9 +117,3 @@ disabled = true
[git_branch] [git_branch]
disabled = true disabled = true
# re-enable git_branch as long as we're not in a jj repo
[custom.git_branch]
when = true
command = "jj root >/dev/null 2>&1 || starship module git_branch"
description = "Only show git_branch if we're not in a jj repo"