dgy
/
hexagons
Archived
1
0
Fork 0
This repository has been archived on 2021-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
hexagons/.config/zsh/conf/00_prompt.zsh

34 lines
741 B
Bash

function precmd() {
if [ -z "$NEW_LINE_BEFORE_PROMPT" ]; then
NEW_LINE_BEFORE_PROMPT=1
elif [ "$NEW_LINE_BEFORE_PROMPT" -eq 1 ]; then
echo "\n"
fi
}
function () {
if [[ $EUID == 0 ]]; then
local SUFFIX='%(?,%F{yellow},%F{red})%n%f:'
else
local SUFFIX='%(?,%F{yellow},%F{red})>%f'
fi
PS1="%B${SUFFIX}%b "
export RPS1="%B%(?..%{%F{red}%}(%?%)%{%f%}) %b%F{12}%2~%f"
}
export SPROMPT="zsh: correct %F{red}'%R'%f to %F{green}'%r'%f [%B%Uy%u%bes, %B%Un%u%bo, %B%Ue%u%bdit, %B%Ua%u%bbort]? "
function zle-keymap-select {
case $KEYMAP in
vicmd) echo -ne '\e[2 q';;
viins|main) echo -ne '\e[6 q';;
esac
}
zle -N zle-keymap-select
_fix_cursor() {
echo -ne '\e[6 q'
}
precmd_functions+=(_fix_cursor)