1
0
mirror of https://github.com/bertptrs/vimconfig.git synced 2025-12-25 12:30:32 +01:00

Implement my own theme.

Theme mostly looks the same, but with slightly less fancy calculations
about line widths. This is okay for now.
This commit is contained in:
2018-09-06 15:59:35 +02:00
parent 9d43150d6b
commit e3d28aba4f
2 changed files with 45 additions and 3 deletions

View File

@@ -42,9 +42,7 @@ then
fi
# Initialize the prompt
autoload -U promptinit
promptinit
prompt bart
source "${ZDOTDIR:-$HOME}/.zshtheme"
# Setup the CNF hook
if [[ -s /usr/share/doc/pkgfile/command-not-found.zsh ]]; then

44
zsh/.config/zsh/.zshtheme Normal file
View File

@@ -0,0 +1,44 @@
# vim: setf zsh
# Allow color escape sequences to be available
autoload -U colors && colors
# Allow calling functions inside prompt
setopt PROMPT_SUBST
function prompt_last_cmd() {
if [[ $HISTCMD -gt 0 ]]; then
echo $history[$((HISTCMD - 1))]
fi
}
function prompt_ps1() {
local ps1 rs='%b%f%k'
local dir="%{$fg[%~]%}%8~$rs"
local hist="%{$fg[blue]%}[\$(prompt_last_cmd)]$rs "
local host="%{$fg[red]%}%m "
local prompt="%n@%{$fg[cyan]%}%m$rs %(#.#.\$) "
ps1=(
"$host"
"$hist"
"$dir"
$'\n'
"$prompt"
)
echo "${(j::)ps1}"
}
function prompt_rprompt() {
local rprompt rs='%b%f%k' hist1 hist2
local exit_status="%(?..%{$fg[red]%}- %{$fg_bold[yellow]%}%? %b%{$fg[red]%}-$rs )"
local datetime="%D %{$fg[red]%}%T%{$reset_color%}"
rprompt=(
"$exit_status"
"$datetime"
)
echo "${(j::)rprompt}"
}
PS1="$(prompt_ps1)"
RPROMPT="$(prompt_rprompt)"