summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-09-17 11:21:26 +0200
committerJulian T <julian@jtle.dk>2020-09-17 11:21:26 +0200
commit81a4b2af4334a83eb026d13933fe04c440469a15 (patch)
tree06aa4b40734934f6ef194b48a86e1c1c6bc02e46
parenta52a730658403e7fdc51defeaabffc7856575459 (diff)
Function for entering nix-shell with zsh shell and color
-rw-r--r--zsh/.zshrc19
1 files changed, 18 insertions, 1 deletions
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 82b25b9..7a7cf9f 100644
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -36,8 +36,14 @@ function git_info {
fi
}
+if [ -z "$INNIXENV" ]; then
+ MAINCOL="%F{032}"
+else
+ MAINCOL="%F{076}"
+fi
+
setopt PROMPT_SUBST
-PROMPT='%F{032}%~$(git_info)%F{032} %(!.#.>) %F{255}'
+PROMPT='$MAINCOL%~$(git_info)$MAINCOL %(!.#.>) %F{255}'
#
# General setting
@@ -66,6 +72,8 @@ bindkey -M menuselect '^[[Z' reverse-menu-complete
bindkey "^P" up-line-or-search
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward
+bindkey "^[[1;5C" forward-word
+bindkey "^[[1;5D" backward-word
#
# Env
@@ -81,3 +89,12 @@ export LSCOLORS="Gxfxcxdxbxegedabagacad"
#
alias vim="nvim"
alias ls='ls --color=auto'
+
+#
+# Functions
+#
+
+function nixenv {
+ export INNIXENV="true"
+ nix-shell $HOME/.shells/$1 --run zsh
+}