Add starship prompt to lf

This commit is contained in:
mintycube 2024-04-23 10:05:50 +05:00
parent 31bc306f22
commit 6a92b4993c
2 changed files with 103 additions and 24 deletions

View File

@ -44,23 +44,9 @@ cmd open ${{
}} }}
cmd on-cd &{{ cmd on-cd &{{
# display repository status in your prompt export STARSHIP_SHELL=
if [ -d .git ] || [ -f .git ]; then fmt="$(starship prompt)"
branch=$(git branch --show-current 2>/dev/null) || true lf -remote "send $id set promptfmt \"$fmt\""
remote=$(git config --get branch.$branch.remote 2>/dev/null) || true
url=$(git remote get-url $remote 2>/dev/null) || true
# "\033[32m \033[35;1m%d\033[0m\033[1m%f\033[0m"
fmt="\033[32m \033[35;1m%d\033[0m\033[1m%f\033[32m  $branch 󰄾 $url\033[0m"
elif [ -d .hg ]; then
hg=$(hg branch 2>/dev/null) || true
fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[33;1m [HG BRANCH:> $hg]\033[0m"
elif [ -d .svn ]; then
svn=$(svn info 2>/dev/null | awk '/^URL: /{print $2}') || true
fmt="\033[32;1m%u@%h\033[0m:\033[34;1m%w\033[0m\033[33;1m [SVN URL:> $svn]\033[0m"
else
fmt="\033[32m \033[35;1m%d\033[0m\033[1m%f\033[0m"
fi
lf -remote "send $id set promptfmt \"$fmt\""
}} }}

View File

@ -1,13 +1,106 @@
[git_branch] add_newline = false
symbol = ' '
[git_metrics] [battery]
disabled = false disabled = true
added_style = 'bold blue'
format = '[+$added]($added_style)/[-$deleted]($deleted_style) ' [cmd_duration]
disabled = true
[gcloud] [gcloud]
disabled = true disabled = true
[battery] [memory_usage]
disabled = true disabled = true
[os]
disabled = true
[time]
disabled = true
[username]
disabled = true
[character]
disabled = true
[git_metrics]
disabled = false
added_style = 'bold blue'
format = ' \[[+$added]($added_style)/[-$deleted]($deleted_style)\] '
[c]
symbol = " "
format = '\[[$symbol($version(-$name))]($style)\]'
[cmake]
format = '\[[$symbol($version)]($style)\]'
[conda]
symbol = " "
format = '\[[$symbol$environment]($style)\]'
[docker_context]
symbol = " "
format = '\[[$symbol$context]($style)\]'
[git_branch]
symbol = ' '
format = '\[[$symbol$branch]($style)\]'
[git_status]
format = '([\[$all_status$ahead_behind\]]($style)) '
[golang]
symbol = '󰟓 '
format = '\[[$symbol($version)]($style)\]'
[gradle]
symbol = ' '
format = '\[[$symbol($version)]($style)\]'
[haskell]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[kotlin]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[kubernetes]
symbol = "󱃾 "
format = '\[[$symbol$context( \($namespace\))]($style)\]'
[lua]
symbol = "󰢱 "
format = '\[[$symbol($version)]($style)\]'
[meson]
format = '\[[$symbol$project]($style)\]'
[nodejs]
symbol = "󰎙 "
format = '\[[$symbol($version)]($style)\]'
[perl]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[php]
symbol = "󰌟 "
format = '\[[$symbol($version)]($style)\]'
[python]
symbol = " "
format = '\[[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)\]'
[ruby]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[rust]
symbol = " "
format = '\[[$symbol($version)]($style)\]'
[sudo]
format = '\[[as $symbol]($style)\]'