mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-06-29 04:00:42 +00:00
Use spaces instead of tabs
This commit is contained in:
parent
b07404d669
commit
d843e90462
4 changed files with 134 additions and 138 deletions
|
@ -30,20 +30,20 @@ export PROMPT_EOL_MARK=""
|
|||
# (unless you change it in kernel), respect this and downgrade
|
||||
# the color scheme accordingly (it won't look best, but it's
|
||||
# still better than no colors)
|
||||
if [ $TERM = "linux" ]; then
|
||||
GREEN="%F{002}"
|
||||
RED="%F{001}"
|
||||
ORANGE="%F{003}"
|
||||
BLUE="%F{004}"
|
||||
LBLUE="%F{006}"
|
||||
PURPLE="%F{005}"
|
||||
if [ "$TERM" = "linux" ]; then
|
||||
GREEN="%F{002}"
|
||||
RED="%F{001}"
|
||||
ORANGE="%F{003}"
|
||||
BLUE="%F{004}"
|
||||
LBLUE="%F{006}"
|
||||
PURPLE="%F{005}"
|
||||
else
|
||||
GREEN="%F{047}"
|
||||
RED="%F{196}"
|
||||
ORANGE="%F{214}"
|
||||
BLUE="%F{027}"
|
||||
LBLUE="%F{075}"
|
||||
PURPLE="%F{105}"
|
||||
GREEN="%F{047}"
|
||||
RED="%F{196}"
|
||||
ORANGE="%F{214}"
|
||||
BLUE="%F{027}"
|
||||
LBLUE="%F{075}"
|
||||
PURPLE="%F{105}"
|
||||
fi
|
||||
RESET="%f"
|
||||
|
||||
|
@ -52,34 +52,34 @@ git_prompt() {
|
|||
ref=$(command git symbolic-ref HEAD 2> /dev/null) || ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
|
||||
echo -n " $ORANGE${ref#refs/heads/}"
|
||||
|
||||
if [ ! -z "$(git status --short 2>/dev/null)" ]; then
|
||||
if [ -n "$(git status --short 2>/dev/null)" ]; then
|
||||
echo "$RED+"
|
||||
fi
|
||||
}
|
||||
|
||||
# Adds @chroot or @ssh
|
||||
foreign_prompt() {
|
||||
if [ "$(awk '$5=="/" {print $1}' </proc/1/mountinfo)" != "$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)" ]; then
|
||||
echo -n "@${ORANGE}chroot"
|
||||
elif [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||
echo -n "@${ORANGE}ssh"
|
||||
fi
|
||||
if [ "$(awk '$5=="/" {print $1}' </proc/1/mountinfo)" != "$(awk '$5=="/" {print $1}' </proc/$$/mountinfo)" ]; then
|
||||
echo -n "@${ORANGE}chroot"
|
||||
elif [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||
echo -n "@${ORANGE}ssh"
|
||||
fi
|
||||
}
|
||||
|
||||
#nd Prints appropriate working directory
|
||||
working_directory() {
|
||||
# By default up to 5 directories will be tolerated before shortening
|
||||
# After we surpass that, first directory (or ~) will be printed together with last 3
|
||||
# This feature uses special symbol '…', but this isn't aviable when in TTY. Because
|
||||
# of this, when we are in TTY, we fall back to longer '...'
|
||||
# By default up to 5 directories will be tolerated before shortening
|
||||
# After we surpass that, first directory (or ~) will be printed together with last 3
|
||||
# This feature uses special symbol '…', but this isn't aviable when in TTY. Because
|
||||
# of this, when we are in TTY, we fall back to longer '...'
|
||||
|
||||
if [ $USE_SHORTENED_WORKDIR != 1 ]; then
|
||||
echo -n " $BLUE$~"
|
||||
elif [ $TERM = "linux" ]; then
|
||||
echo -n " $BLUE%(5~|%-1~/.../%3~|%4~)"
|
||||
else
|
||||
echo -n " $BLUE%(5~|%-1~/…/%3~|%4~)"
|
||||
fi
|
||||
if [ $USE_SHORTENED_WORKDIR != 1 ]; then
|
||||
echo -n " $BLUE$~"
|
||||
elif [ $TERM = "linux" ]; then
|
||||
echo -n " $BLUE%(5~|%-1~/.../%3~|%4~)"
|
||||
else
|
||||
echo -n " $BLUE%(5~|%-1~/…/%3~|%4~)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Execution time tracking hooks, this is unique to zsh, as it can add
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue