summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2018-04-15 13:31:31 +0200
committerEduardo Pedroni <e.pedroni91@gmail.com>2018-04-15 13:31:31 +0200
commit66eac40675f320d859291fac6b4944a095c8d7d2 (patch)
treef5c7a1b8d77971e77b9617f789a084814c9f8a6a
parentf83e3aa0c9e1472e52473ecaa2097b596638dda2 (diff)
Renamed .zprofile to .zlogin for compatibility with the options file, added options file and support for it in .zshrc
-rw-r--r--.cfgopts4
-rw-r--r--.zlogin1
-rw-r--r--.zprofile1
-rw-r--r--.zshrc27
4 files changed, 23 insertions, 10 deletions
diff --git a/.cfgopts b/.cfgopts
new file mode 100644
index 0000000..f1c9aa0
--- /dev/null
+++ b/.cfgopts
@@ -0,0 +1,4 @@
+# Zsh options file, loaded from .zshrc.
+ZOPT_PROMPT_COLOUR="green"
+ZOPT_SSH_AGENT_EN=1
+ZOPT_PATH_APPEND="$HOME/bin"
diff --git a/.zlogin b/.zlogin
new file mode 100644
index 0000000..e785e17
--- /dev/null
+++ b/.zlogin
@@ -0,0 +1 @@
+export PATH="$PATH:${${ZOPT_PATH_APPEND#:}%:}"
diff --git a/.zprofile b/.zprofile
deleted file mode 100644
index 1383a43..0000000
--- a/.zprofile
+++ /dev/null
@@ -1 +0,0 @@
-export PATH="$PATH:$HOME/bin:$HOME/.rust:$ONOS_ROOT/tools/build:$ONOS_ROOT/tools/test/bin:$ONOS_ROOT/tools/dev/bin"
diff --git a/.zshrc b/.zshrc
index 5bb0a87..b94803b 100644
--- a/.zshrc
+++ b/.zshrc
@@ -12,11 +12,20 @@ unsetopt autocd beep
bindkey -e
# End of lines configured by zsh-newuser-install
+# Source cfgopts before anything else
+source "$HOME/.cfgopts"
+
# Aliases from .zsh-aliases for convenience
-source ~/.zsh_aliases
+source "$HOME/.zsh_aliases"
+
+# Make sure ssh-agent is running and accessible, if required
+if [ $ZOPT_SSH_AGENT_EN -eq 1 ]; then
+ source "$HOME/.zsh/ssh-agent-setup.sh"
+fi
-# Make sure ssh-agent is running and accessible
-source ~/.zsh/ssh-agent-setup.sh
+# Git information in the prompt, if required
+setopt prompt_subst
+source "$HOME/.zsh/git-prompt.sh"
# Stupid keys don't work by default
#bindkey "^[[2~" # Insert
@@ -26,14 +35,11 @@ bindkey "^[[5~" up-history # Page up
bindkey "^[[6~" down-history # Page down
bindkey "^[[F" end-of-line # End
-# Git prompt function
-setopt prompt_subst
-source ~/.zsh/git-prompt.sh
-
# Custom prompt, should look like this:
-# user@hostname ~/working/directory git_branch_if_any $
+# [hh:mm:ss] user@host ~
+# $
NEWLINE=$'\n'
-export PROMPT="%B%F{green}[%*]%f%b %n@%m %4~%B%F{green}\$(__git_ps1 "%s")%f%b${NEWLINE}%B%(!.#.$)%b "
+export PROMPT="%B%F{$ZOPT_PROMPT_COLOUR}[%*]%f%b %n@%m %4~%B%F{green}\$(__git_ps1 "%s")%f%b${NEWLINE}%B%(!.#.$)%b "
# Coloured man pages
man() {
@@ -46,3 +52,6 @@ man() {
LESS_TERMCAP_us=$'\E[04;38;5;146m' \
man "$@"
}
+
+#export PATH="$PATH:$HOME/bin"
+