zsh: zsh: i have further fucked it
This commit is contained in:
parent
2abcef1ce1
commit
b7fa9465c6
3
zsh/.config/zsh/config.d/00_create_arrays.zsh
Normal file
3
zsh/.config/zsh/config.d/00_create_arrays.zsh
Normal file
|
@ -0,0 +1,3 @@
|
|||
# creates the preexec_functions and precmd_functions arrays to be filled later
|
||||
export preexec_functions=()
|
||||
export precmd_functions=()
|
|
@ -10,4 +10,3 @@ precmd_functions+="vcs_info"
|
|||
|
||||
# Prompt shows hostname if connected to a remote or if root
|
||||
PROMPT="%B$([ -n "$is_remote" ] || [ "$EUID" = 0 ] && echo "%F{magenta}%m%f ")%F{$([ "$EUID" = 0 ] && echo "red" || echo "cyan")}%n%f %F{blue}%~%f%b \${vcs_info_msg_0_}%B%#%b "
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
# Hook preexec/precmd to dynamically set rprompt with useful info
|
||||
preexec_functions+=start_prompt_timer
|
||||
function start_prompt_timer {
|
||||
# Store command execution start time
|
||||
timer="${timer:-"$(date +%s.%N)"}"
|
||||
}
|
||||
preexec_functions+="start_prompt_timer"
|
||||
|
||||
# this actually does need to be the precmd function because it needs to run
|
||||
# before any other precmd hooks (e.g. the VS Code terminal integration hook)
|
||||
# happen, otherwise $? will be fucked
|
||||
function precmd {
|
||||
# this needs to be the first precmd function because it needs to run before any
|
||||
# other precmd hooks (e.g. the VS Code terminal integration hook) happen,
|
||||
# otherwise $? will be fucked
|
||||
precmd_functions=(build_rprompt ${precmd_functions[@]})
|
||||
function build_rprompt {
|
||||
# Start with a fresh prompt
|
||||
RPROMPT=""
|
||||
if [ -z $new_session ]; then
|
||||
|
|
Loading…
Reference in a new issue