Removed spaceship prompt, added powerlevel10k
This commit is contained in:
parent
5cca5b1d66
commit
108102ca2b
1 changed files with 36 additions and 2 deletions
38
zsh/zshrc
38
zsh/zshrc
|
@ -47,9 +47,43 @@ antigen bundle zsh-users/zsh-syntax-highlighting
|
||||||
antigen bundle zsh-users/zsh-completions
|
antigen bundle zsh-users/zsh-completions
|
||||||
antigen bundle asdf
|
antigen bundle asdf
|
||||||
|
|
||||||
antigen theme https://github.com/denysdovhan/spaceship-prompt spaceship
|
antigen theme romkatv/powerlevel10k powerlevel10k
|
||||||
|
|
||||||
antigen apply
|
antigen apply
|
||||||
|
|
||||||
|
|
||||||
|
# custom functions for powerlevel9k
|
||||||
|
POWERLEVEL9K_ELIXIR_ICON=$'🥃'
|
||||||
|
prompt_asdf_elixir() {
|
||||||
|
if [ $commands[asdf] ]; then
|
||||||
|
ELIXIR_ICON=$'🥃'
|
||||||
|
local asdf_global_conf="$HOME/.tool-versions"
|
||||||
|
local version_regex="s/^\([.0-9]*\).*/\1/p"
|
||||||
|
local config_regex="s/.*(set by \(.*\))/\1/p"
|
||||||
|
|
||||||
|
local elixir_current="$(asdf current elixir)"
|
||||||
|
local elixir_current_version="$(echo $elixir_current | sed -n $version_regex)"
|
||||||
|
local elixir_current_conf="$(echo $elixir_current | sed -n $config_regex)"
|
||||||
|
|
||||||
|
local erlang_current="$(asdf current erlang)"
|
||||||
|
local erlang_current_version="$(echo $erlang_current | sed -n $version_regex)"
|
||||||
|
local erlang_current_conf="$(echo $erlang_current | sed -n $config_regex)"
|
||||||
|
if [[ "${asdf_global_conf}" != "${elixir_current_conf}" || "${asdf_global_conf}" != "${erlang_current_conf}" ]]; then
|
||||||
|
echo -n "🥃 $elixir_current_version (on Erlang $erlang_current_version)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
POWERLEVEL9K_CUSTOM_ASDF_ELIXIR="prompt_asdf_elixir"
|
||||||
|
|
||||||
|
export POWERLEVEL9K_IGNORE_TERM_COLORS=true
|
||||||
|
export POWERLEVEL9K_PROMPT_ON_NEWLINE=true
|
||||||
|
export POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
|
||||||
|
export POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir dir_writable vcs custom_asdf_elixir)
|
||||||
|
export POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(virtualenv command_execution_time)
|
||||||
|
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
alias 'onedrive-journal'="journalctl --user-unit onedrive -f"
|
alias 'onedrive-journal'="journalctl --user-unit onedrive -f"
|
||||||
alias exa="exa -l --git"
|
alias exa="exa -l --git"
|
||||||
|
|
||||||
|
@ -72,7 +106,7 @@ else
|
||||||
touch $HOME/.zshsrc
|
touch $HOME/.zshsrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export TERM="tmux-256color"
|
# export TERM="tmux-256color"
|
||||||
export SHELL="/bin/zsh"
|
export SHELL="/bin/zsh"
|
||||||
# asdf
|
# asdf
|
||||||
. $HOME/.asdf/asdf.sh
|
. $HOME/.asdf/asdf.sh
|
||||||
|
|
Loading…
Add table
Reference in a new issue