Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
511f87ea1c | ||
|
|
40f0a4c947 | ||
|
|
34e70b669e | ||
|
|
4ed3b37877 |
@@ -9,6 +9,8 @@ export ZSH="$HOME/.oh-my-zsh"
|
|||||||
# to know which specific one was loaded, run: echo $RANDOM_THEME
|
# to know which specific one was loaded, run: echo $RANDOM_THEME
|
||||||
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
|
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
|
||||||
ZSH_THEME="vulporuza"
|
ZSH_THEME="vulporuza"
|
||||||
|
# Palettes: ~/.dotfiles/vulporuza-palettes.zsh
|
||||||
|
VULPORUZA_PALETTE=current
|
||||||
|
|
||||||
# Set list of themes to pick from when loading at random
|
# Set list of themes to pick from when loading at random
|
||||||
# Setting this variable when ZSH_THEME=random will cause zsh to load
|
# Setting this variable when ZSH_THEME=random will cause zsh to load
|
||||||
@@ -70,6 +72,7 @@ ZSH_THEME="vulporuza"
|
|||||||
# Add wisely, as too many plugins slow down shell startup.
|
# Add wisely, as too many plugins slow down shell startup.
|
||||||
plugins=(
|
plugins=(
|
||||||
gitfast
|
gitfast
|
||||||
|
virtualenv
|
||||||
zsh-syntax-highlighting
|
zsh-syntax-highlighting
|
||||||
zsh-autosuggestions
|
zsh-autosuggestions
|
||||||
# zsh-history-substring-search
|
# zsh-history-substring-search
|
||||||
|
|||||||
@@ -5,6 +5,10 @@
|
|||||||
enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
|
enabled_plugins = TerminalShot, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
|
||||||
suppress_multiple_term_dialog = True
|
suppress_multiple_term_dialog = True
|
||||||
[keybindings]
|
[keybindings]
|
||||||
|
go_up = <Primary><Alt>Up
|
||||||
|
go_down = <Primary><Alt>Down
|
||||||
|
go_left = <Primary><Alt>Left
|
||||||
|
go_right = <Primary><Alt>Right
|
||||||
[profiles]
|
[profiles]
|
||||||
[[default]]
|
[[default]]
|
||||||
background_darkness = 0.7
|
background_darkness = 0.7
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
# vulporuza-palettes.zsh
|
||||||
|
# Sourced by vulporuza.zsh-theme. Requires Oh My Zsh spectrum ($FG) and colors.
|
||||||
|
#
|
||||||
|
# Select one with VULPORUZA_PALETTE in ~/.zshrc (before Oh My Zsh):
|
||||||
|
# current | fox | frost | tokyo | quiet
|
||||||
|
|
||||||
|
typeset -ga _vulporuza_keys
|
||||||
|
_vulporuza_keys=(
|
||||||
|
dash path branch venv host dirty clean
|
||||||
|
staged conflicts changed untracked stashed
|
||||||
|
upstream state error
|
||||||
|
)
|
||||||
|
|
||||||
|
typeset -gA _vulporuza_p_current
|
||||||
|
_vulporuza_p_current=(
|
||||||
|
dash "$FG[240]"
|
||||||
|
path "$FG[208]"
|
||||||
|
branch "%{$fg_bold[magenta]%}"
|
||||||
|
venv "$FG[075]"
|
||||||
|
host "$FG[245]"
|
||||||
|
dirty "$FG[075]"
|
||||||
|
clean "$FG[034]"
|
||||||
|
staged "%{$fg[red]%}"
|
||||||
|
conflicts "%{$fg[red]%}"
|
||||||
|
changed "%{$fg[blue]%}"
|
||||||
|
untracked "%{$fg[cyan]%}"
|
||||||
|
stashed "%{$fg_bold[blue]%}"
|
||||||
|
upstream "%{$fg[blue]%}"
|
||||||
|
state "%{$fg_bold[magenta]%}"
|
||||||
|
error "%{$fg[red]%}"
|
||||||
|
)
|
||||||
|
|
||||||
|
typeset -gA _vulporuza_p_fox
|
||||||
|
_vulporuza_p_fox=(
|
||||||
|
dash "$FG[236]"
|
||||||
|
path "$FG[166]"
|
||||||
|
branch "$FG[180]"
|
||||||
|
venv "$FG[073]"
|
||||||
|
host "$FG[240]"
|
||||||
|
dirty "$FG[172]"
|
||||||
|
clean "$FG[107]"
|
||||||
|
staged "$FG[167]"
|
||||||
|
conflicts "$FG[167]"
|
||||||
|
changed "$FG[109]"
|
||||||
|
untracked "$FG[080]"
|
||||||
|
stashed "$FG[110]"
|
||||||
|
upstream "$FG[109]"
|
||||||
|
state "$FG[180]"
|
||||||
|
error "$FG[167]"
|
||||||
|
)
|
||||||
|
|
||||||
|
typeset -gA _vulporuza_p_frost
|
||||||
|
_vulporuza_p_frost=(
|
||||||
|
dash "$FG[237]"
|
||||||
|
path "$FG[109]"
|
||||||
|
branch "$FG[110]"
|
||||||
|
venv "$FG[108]"
|
||||||
|
host "$FG[243]"
|
||||||
|
dirty "$FG[173]"
|
||||||
|
clean "$FG[114]"
|
||||||
|
staged "$FG[167]"
|
||||||
|
conflicts "$FG[167]"
|
||||||
|
changed "$FG[109]"
|
||||||
|
untracked "$FG[080]"
|
||||||
|
stashed "$FG[110]"
|
||||||
|
upstream "$FG[110]"
|
||||||
|
state "$FG[139]"
|
||||||
|
error "$FG[167]"
|
||||||
|
)
|
||||||
|
|
||||||
|
typeset -gA _vulporuza_p_tokyo
|
||||||
|
_vulporuza_p_tokyo=(
|
||||||
|
dash "$FG[237]"
|
||||||
|
path "$FG[111]"
|
||||||
|
branch "$FG[141]"
|
||||||
|
venv "$FG[080]"
|
||||||
|
host "$FG[242]"
|
||||||
|
dirty "$FG[215]"
|
||||||
|
clean "$FG[114]"
|
||||||
|
staged "$FG[167]"
|
||||||
|
conflicts "$FG[167]"
|
||||||
|
changed "$FG[109]"
|
||||||
|
untracked "$FG[087]"
|
||||||
|
stashed "$FG[110]"
|
||||||
|
upstream "$FG[111]"
|
||||||
|
state "$FG[141]"
|
||||||
|
error "$FG[167]"
|
||||||
|
)
|
||||||
|
|
||||||
|
typeset -gA _vulporuza_p_quiet
|
||||||
|
_vulporuza_p_quiet=(
|
||||||
|
dash "$FG[238]"
|
||||||
|
path "$FG[208]"
|
||||||
|
branch "$FG[250]"
|
||||||
|
venv "$FG[244]"
|
||||||
|
host "$FG[240]"
|
||||||
|
dirty "$FG[244]"
|
||||||
|
clean "$FG[034]"
|
||||||
|
staged "$FG[167]"
|
||||||
|
conflicts "$FG[167]"
|
||||||
|
changed "$FG[109]"
|
||||||
|
untracked "$FG[080]"
|
||||||
|
stashed "$FG[110]"
|
||||||
|
upstream "$FG[244]"
|
||||||
|
state "$FG[250]"
|
||||||
|
error "$FG[167]"
|
||||||
|
)
|
||||||
|
|
||||||
|
_vulporuza_apply_palette() {
|
||||||
|
emulate -L zsh
|
||||||
|
local name=${VULPORUZA_PALETTE:-current}
|
||||||
|
if ! (( ${+parameters[_vulporuza_p_$name]} )); then
|
||||||
|
print -u2 "vulporuza: unknown VULPORUZA_PALETTE '${name}', using current"
|
||||||
|
name=current
|
||||||
|
VULPORUZA_PALETTE=current
|
||||||
|
fi
|
||||||
|
typeset -gA _vulporuza
|
||||||
|
_vulporuza=()
|
||||||
|
local key
|
||||||
|
for key in "${_vulporuza_keys[@]}"; do
|
||||||
|
eval "_vulporuza[\$key]=\${_vulporuza_p_${name}[\$key]}"
|
||||||
|
done
|
||||||
|
}
|
||||||
+54
-30
@@ -1,55 +1,79 @@
|
|||||||
# vulporuza.zsh-theme
|
# vulporuza.zsh-theme
|
||||||
|
#
|
||||||
|
# Palette: set VULPORUZA_PALETTE in ~/.zshrc before Oh My Zsh.
|
||||||
|
# Definitions: vulporuza-palettes.zsh (same directory).
|
||||||
|
|
||||||
typeset my_gray="$FG[240]"
|
typeset _vulporuza_dir="${${(%):-%x}:A:h}"
|
||||||
|
if ! source "${_vulporuza_dir}/vulporuza-palettes.zsh"; then
|
||||||
|
print -u2 "vulporuza: missing ${_vulporuza_dir}/vulporuza-palettes.zsh"
|
||||||
|
unset _vulporuza_dir
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
unset _vulporuza_dir
|
||||||
|
|
||||||
|
_vulporuza_apply_palette
|
||||||
|
|
||||||
|
# Optional widgets: zsh-git-prompt and virtualenv plugin may be missing.
|
||||||
|
if (( $+functions[git_super_status] )); then
|
||||||
|
_vulporuza_git='$(git_super_status)'
|
||||||
|
else
|
||||||
|
_vulporuza_git='$(git_prompt_info)'
|
||||||
|
fi
|
||||||
|
if (( $+functions[virtualenv_prompt_info] )); then
|
||||||
|
_vulporuza_venv='$(virtualenv_prompt_info)'
|
||||||
|
else
|
||||||
|
_vulporuza_venv=''
|
||||||
|
fi
|
||||||
|
|
||||||
# Primary prompt
|
# Primary prompt
|
||||||
if [ -z "${__GIT_PROMPT_DIR}" ]; then
|
PS1='${_vulporuza[dash]}${(r:$COLUMNS::-:)}%{$reset_color%}
|
||||||
PS1='$my_gray${(r:$COLUMNS::-:)}%{$reset_color%}╭ %T %{$FG[208]%}%~%{$reset_color%}$(git_prompt_info)
|
╭ %T ${_vulporuza[path]}%~%{$reset_color%}'$_vulporuza_git'
|
||||||
╰ %(!.#.») '
|
╰'$_vulporuza_venv' %(!.#.») '
|
||||||
else
|
|
||||||
PS1='$my_gray${(r:$COLUMNS::-:)}%{$reset_color%}╭ %T %{$FG[208]%}%~%{$reset_color%}$(git_super_status)
|
PS2='${_vulporuza[error]}\ %{$reset_color%}'
|
||||||
╰ %(!.#.») '
|
|
||||||
fi
|
unset _vulporuza_git _vulporuza_venv
|
||||||
PS2='%{$fg[red]%}\ %{$reset_color%}'
|
|
||||||
|
|
||||||
# Right prompt
|
# Right prompt
|
||||||
RPS1='%(?..%{$fg[red]%}%? ↵%{$reset_color%}) $FG[245]%n@%m%{$reset_color%}%'
|
RPS1='%(?..${_vulporuza[error]}%? ↵%{$reset_color%}) ${_vulporuza[host]}%n@%m%{$reset_color%}'
|
||||||
|
|
||||||
# Git theme
|
# Virtualenv (plugin virtualenv)
|
||||||
|
ZSH_THEME_VIRTUALENV_PREFIX=" ${_vulporuza[venv]}("
|
||||||
|
ZSH_THEME_VIRTUALENV_SUFFIX=")%{$reset_color%}"
|
||||||
|
|
||||||
|
# Git: shared wrapper
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$reset_color%}["
|
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$reset_color%}["
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}]"
|
||||||
|
|
||||||
if [ -z "${__GIT_PROMPT_DIR}" ]; then
|
if (( $+functions[git_super_status] )); then
|
||||||
# git settings
|
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}|%{$FG[034]%}✔"
|
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}|%{$FG[075]%}…"
|
|
||||||
else
|
|
||||||
ZSH_THEME_GIT_PROMPT_HASH_PREFIX=":"
|
ZSH_THEME_GIT_PROMPT_HASH_PREFIX=":"
|
||||||
ZSH_THEME_GIT_PROMPT_SEPARATOR="|"
|
ZSH_THEME_GIT_PROMPT_SEPARATOR="|"
|
||||||
ZSH_THEME_GIT_PROMPT_BRANCH="%{$fg_bold[magenta]%}"
|
ZSH_THEME_GIT_PROMPT_BRANCH="${_vulporuza[branch]}"
|
||||||
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg[red]%}%{●%1G%}"
|
ZSH_THEME_GIT_PROMPT_STAGED="${_vulporuza[staged]}%{●%1G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{$fg[red]%}%{✖%1G%}"
|
ZSH_THEME_GIT_PROMPT_CONFLICTS="${_vulporuza[conflicts]}%{✖%1G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CHANGED="%{$fg[blue]%}%{✚%1G%}"
|
ZSH_THEME_GIT_PROMPT_CHANGED="${_vulporuza[changed]}%{✚%1G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_BEHIND="%{↓%1G%}"
|
ZSH_THEME_GIT_PROMPT_BEHIND="%{↓%1G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_AHEAD="%{↑%1G%}"
|
ZSH_THEME_GIT_PROMPT_AHEAD="%{↑%1G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_STASHED="%{$fg_bold[blue]%}%{⚑%1G%}"
|
ZSH_THEME_GIT_PROMPT_STASHED="${_vulporuza[stashed]}%{⚑%1G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%}%{…%1G%}"
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="${_vulporuza[untracked]}%{…%1G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[green]%}%{✔%1G%}"
|
ZSH_THEME_GIT_PROMPT_CLEAN="${_vulporuza[clean]}%{✔%1G%}"
|
||||||
ZSH_THEME_GIT_PROMPT_LOCAL=" L"
|
ZSH_THEME_GIT_PROMPT_LOCAL=" L"
|
||||||
# The remote branch will be shown between these two
|
ZSH_THEME_GIT_PROMPT_UPSTREAM_FRONT=" {${_vulporuza[upstream]}"
|
||||||
ZSH_THEME_GIT_PROMPT_UPSTREAM_FRONT=" {%{$fg[blue]%}"
|
|
||||||
ZSH_THEME_GIT_PROMPT_UPSTREAM_END="%{${reset_color}%}}"
|
ZSH_THEME_GIT_PROMPT_UPSTREAM_END="%{${reset_color}%}}"
|
||||||
ZSH_THEME_GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}|MERGING%{${reset_color}%}"
|
ZSH_THEME_GIT_PROMPT_MERGING="${_vulporuza[state]}|MERGING%{${reset_color}%}"
|
||||||
ZSH_THEME_GIT_PROMPT_REBASE="%{$fg_bold[magenta]%}|REBASE%{${reset_color}%} "
|
ZSH_THEME_GIT_PROMPT_REBASE="${_vulporuza[state]}|REBASE%{${reset_color}%} "
|
||||||
ZSH_THEME_GIT_PROMPT_BISECT="%{$fg_bold[magenta]%}|BISECT%{${reset_color}%} "
|
ZSH_THEME_GIT_PROMPT_BISECT="${_vulporuza[state]}|BISECT%{${reset_color}%} "
|
||||||
|
else
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$reset_color%}|${_vulporuza[clean]}✔"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}|${_vulporuza[dirty]}…"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function theme_preexec {
|
function theme_preexec {
|
||||||
print -nr $'\e]2;'"$USER@$(hostname) » $PWD » $1 $2"$'\a'
|
print -nr $'\e]2;'"$USER@$HOST » $PWD » $1"$'\a'
|
||||||
}
|
}
|
||||||
add-zsh-hook preexec theme_preexec
|
add-zsh-hook preexec theme_preexec
|
||||||
|
|
||||||
function theme_precmd {
|
function theme_precmd {
|
||||||
print -nr $'\e]2;'"$USER@$(hostname) » $PWD"$'\a'
|
print -nr $'\e]2;'"$USER@$HOST » $PWD"$'\a'
|
||||||
}
|
}
|
||||||
add-zsh-hook precmd theme_precmd
|
add-zsh-hook precmd theme_precmd
|
||||||
|
|||||||
Reference in New Issue
Block a user