mirror of
https://github.com/bertptrs/vimconfig.git
synced 2025-12-25 20:40: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:
@@ -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
44
zsh/.config/zsh/.zshtheme
Normal 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)"
|
||||
Reference in New Issue
Block a user