summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-07-15 02:12:32 -0400
committerJesse Luehrs <doy@tozt.net>2023-07-15 02:12:32 -0400
commitc7a8dfa19beabce1a33d8567d235fa064af8cf9d (patch)
treedda32b85d0898a276806899c06691c6ac7669560
parent3446e4d81d45ff5f9ff42d183c85a25d65aa4018 (diff)
downloadconf-c7a8dfa19beabce1a33d8567d235fa064af8cf9d.tar.gz
conf-c7a8dfa19beabce1a33d8567d235fa064af8cf9d.zip
switch to starship
-rw-r--r--Makefile1
-rw-r--r--bashrc5
-rw-r--r--config/starship.toml117
-rw-r--r--zshrc19
4 files changed, 122 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index a1f0be7..56c0449 100644
--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,7 @@ INSTALL := \
.config/sh/env \
.config/sh/functions \
.config/sh/fzf \
+ .config/starship.toml \
.config/tex/jesse_essay.sty \
.config/tex/jesse_letter.sty \
.config/tex/jesse_macros.sty \
diff --git a/bashrc b/bashrc
index c6015cf..9341497 100644
--- a/bashrc
+++ b/bashrc
@@ -61,9 +61,8 @@ source ~/.config/sh/fzf/shell/completion.bash
source ~/.config/sh/fzf/shell/key-bindings.bash
# }}}
# prompt {{{
-if type fancy-prompt > /dev/null 2>&1; then
- __err=0
- export PROMPT_COMMAND="__err=\$?;$PROMPT_COMMAND;PS1=\"\$(fancy-prompt --prompt-escape bash \$__err)\""
+if type starship > /dev/null 2>&1; then
+ eval "$(starship init bash)"
fi
# }}}
# }}}
diff --git a/config/starship.toml b/config/starship.toml
new file mode 100644
index 0000000..102014a
--- /dev/null
+++ b/config/starship.toml
@@ -0,0 +1,117 @@
+format = """
+ [\\(](host)$directory([|](host)$git_branch$git_commit$git_status([|](host)$git_state))[\\)](host)( $aws)( $kubernetes)( $pulumi) $fill ($cmd_duration )($battery )$username[@](bg)$hostname [\\[](host)$time[\\]](host) $line_break\
+$status [\\$](user)
+"""
+right_format = '$character'
+add_newline = false
+palette = 'local'
+
+[directory]
+format = '[$path]($style)[$read_only]($read_only_style)'
+style = 'bg'
+repo_root_format = '[$before_root_path]($before_repo_root_style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style)'
+repo_root_style = 'git'
+fish_style_pwd_dir_length = 1
+
+[git_state]
+format = '[$state(:$progress_current/$progress_total)]($style)'
+style = 'git'
+rebase = 'r'
+merge = 'm'
+revert = 'v'
+cherry_pick = 'c'
+bisect = 'b'
+am = 'a'
+am_or_rebase = 'r'
+
+[git_branch]
+format = '[$branch(:$remote_branch)]($style)'
+style = 'git'
+ignore_branches = ['main', 'master']
+
+[git_commit]
+format = '[$hash$tag]($style)'
+style = 'git'
+
+[git_status]
+format = '[$all_status$ahead_behind]($style)'
+modified = '*'
+stashed = ''
+diverged = '+$ahead_count-$behind_count'
+ahead = '+$count'
+behind = '-$count'
+
+[aws]
+format = '[$symbol$profile]($style)'
+symbol = '☁️'
+style = 'bg'
+
+[kubernetes]
+disabled = false
+format = '[$symbol$context]($style)'
+symbol = '☸'
+style = 'bg'
+
+[pulumi]
+format = '[$symbol$stack]($style)'
+symbol = ''
+style = 'bg'
+
+[fill]
+symbol = '─'
+style = 'bg'
+
+[cmd_duration]
+format = '[\($duration\)]($style)'
+style = 'bg'
+
+[battery]
+format = '[$percentage]($style)'
+
+[[battery.display]]
+threshold = 5
+style = 'bright-red'
+
+[[battery.display]]
+threshold = 15
+style = 'red'
+
+[[battery.display]]
+threshold = 40
+style = 'yellow'
+
+[username]
+disabled = false
+format = '[$user]($style)'
+style_user = 'user'
+show_always = true
+
+[hostname]
+disabled = false
+format = '[$ssh_symbol$hostname]($style)'
+style = 'host'
+ssh_only = false
+
+[time]
+disabled = false
+format = '[$time]($style)'
+style = 'bg'
+
+[line_break]
+
+[status]
+disabled = false
+format = '[$status]($style)'
+
+[character]
+format = '$symbol'
+success_symbol = ''
+error_symbol = ''
+vimcmd_symbol = '[\[NOR\]](bright-yellow)'
+
+[palettes.local]
+bg = 'bright-black'
+host = 'red'
+user = 'bright-blue'
+root = 'bright-red'
+git = 'green'
diff --git a/zshrc b/zshrc
index 31819a7..2fa8d52 100644
--- a/zshrc
+++ b/zshrc
@@ -79,24 +79,9 @@ source ~/.vim/pack/plugins/start/history-sync/sh/history-sync.zsh
# }}}
# }}}
# prompt {{{
-if type fancy-prompt > /dev/null 2>&1; then
- function shell_prompt_precmd () {
- PROMPT=`fancy-prompt --prompt-escape zsh $?`
- RPS1=''
- }
- precmd_functions+=(shell_prompt_precmd)
+if type starship > /dev/null 2>&1; then
+ eval "$(starship init zsh)"
fi
-function zle-keymap-select () {
- setopt localoptions no_ksharrays
- { [[ "${@[2]-main}" == opp ]] } && return
- if [[ "x$KEYMAP" == 'xmain' ]]; then
- RPS1=''
- else
- RPS1="%{$fg_bold[yellow]%}[${KEYMAP/vicmd/NORMAL}]%{$reset_color%}"
- fi
- zle reset-prompt
-}
-zle -N zle-keymap-select
# }}}
# }}}
# fortune {{{