1
0
Fork 0
mirror of https://gitlab.com/mlunax/dotfiles.git synced 2025-04-18 00:16:49 +00:00

Add starship prompt to zshrc config

This commit is contained in:
Luna 2023-06-02 11:48:46 +02:00
parent d5796fc574
commit 1ae9d47593
2 changed files with 57 additions and 7 deletions

19
.zshrc
View file

@ -1,16 +1,22 @@
iscmd() {
command -v "$1" > /dev/null
}
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export TERM="xterm-256color"
export OTHER=$HOME/.zsh
export ZSH=$HOME/.oh-my-zsh
export ZSH_THEME="powerlevel10k/powerlevel10k"
source $OTHER/powerlevel_settings.sh
#COMPLETION_WAITING_DOTS="false"
source $ZSH/oh-my-zsh.sh
if iscmd starship; then
source <(starship init zsh --print-full-init)
else
export ZSH_THEME="powerlevel10k/powerlevel10k"
source $OTHER/powerlevel_settings.sh
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
fi
plugins=(git docker docker-compose virtualenv)
@ -64,6 +70,5 @@ if [ -d "$HOME/.zsh-custom" ]; then
fi
DISABLE_MAGIC_FUNCTIONS=true
source $ZSH/oh-my-zsh.sh
# autoload -Uz compinit && compinit -i
source $OTHER/func.zsh

45
config/starship.toml Normal file
View file

@ -0,0 +1,45 @@
# Adapted from: https://github.com/ptrcnull/dotfiles/blob/master/config/starship.toml
add_newline = true
format = """
$env_var\
$username\
$hostname\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$python\
$character"""
[env_var.CUSTOM_PROMPT_TAG]
format = "[$env_value]($style) "
style = "green bold"
[username]
format = "[$user]($style)@"
[hostname]
format = "[$hostname]($style) "
[directory]
truncate_to_repo = false
fish_style_pwd_dir_length = 3
[git_status]
format = "$ahead_behind$conflicted$stashed$deleted$renamed$staged$modified$untracked"
ahead = "[⇡${count}](yellow) "
behind = "[⇣${count}](yellow) "
stashed = "[*${count}](yellow) "
deleted = "[x${count}](red) "
staged = "[+${count}](yellow) "
modified = "[!${count}](yellow) "
untracked = "[?${count}](cyan) "
[python]
format = 'with [${symbol}${pyenv_prefix}($virtualenv )]($style)'
detect_files = []
detect_extensions = []