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:
parent
d5796fc574
commit
1ae9d47593
2 changed files with 57 additions and 7 deletions
19
.zshrc
19
.zshrc
|
@ -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
45
config/starship.toml
Normal 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 = []
|
Loading…
Add table
Reference in a new issue