From 81a4b2af4334a83eb026d13933fe04c440469a15 Mon Sep 17 00:00:00 2001 From: Julian T Date: Thu, 17 Sep 2020 11:21:26 +0200 Subject: Function for entering nix-shell with zsh shell and color --- zsh/.zshrc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'zsh') 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 +} -- cgit v1.2.3