summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Holman <dholman@gymli.org>2018-03-01 12:18:47 -0600
committerDaniel Holman <dholman@gymli.org>2018-03-01 12:18:47 -0600
commit63901a69beaf0ff1523f1817da50a187ceb25ad7 (patch)
tree2eb0aae5decc26dd3d260e72772ebcc950e2cace
parent4addb4b5b7eebf2da3343f7b8a48c8e317f29b52 (diff)
Made .zshrc a little clearer and more useful
Inserted comments above large blocks of shell config and changed the prompt to also print the return code of the last command to the left of the prompt
-rw-r--r--.zshrc12
1 files changed, 10 insertions, 2 deletions
diff --git a/.zshrc b/.zshrc
index 19ec142..91f1569 100644
--- a/.zshrc
+++ b/.zshrc
@@ -13,6 +13,9 @@ autoload -Uz compinit
compinit
# End of lines added by compinstall
+# Additional colors
+autoload -U colors %% colors
+
# Additional completion options
zstyle ':completion:*' use-cache on
zstyle ':completion:*:cd:*' ignore-parents parent pwd
@@ -23,6 +26,7 @@ zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*' squeeze-slashes true
+# Useful scripts
source /usr/share/doc/pkgfile/command-not-found.zsh
source /usr/share/git/completion/git-prompt.sh
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
@@ -32,13 +36,15 @@ source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
+# Aliases
alias ls="ls --color=auto"
alias pacin="pacaur -S"
alias pacr="pacaur -Rns"
alias pacup="pacaur -Syu"
alias pacsearch="pacaur -Ss"
-alias msfconsole="msfconsole --quiet -x \"db_connect ${USER}@msf\""
+alias msfconsole="sudo msfconsole --quiet -x \"db_connect root@msf\""
+# Important vars
export PATH="$PATH:/home/dholman/bin"
export EDITOR="vim"
export SUDO_EDITOR="vim"
@@ -46,11 +52,13 @@ export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0
export GPGKEY=90D8F8E2C830F6129B2FBB1133836B30AA014B82
export GPG_TTY=$(tty)
+# Prompt settings
+local return_code="%(?..%{$fg[red]%}%? ${exclaim}%{$reset_color%})"
setopt PROMPT_SUBST
GIT_PS1_SHOWUPSTREAM=auto
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
-PS1='$(__git_ps1 "(%s)")\$ '
+PS1='${return_code}$(__git_ps1 "(%s)")$ '
# Make shell stuff behave nicely
man() {