diff options
author | Julian T <julian@jtle.dk> | 2020-09-17 11:21:26 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-09-17 11:21:26 +0200 |
commit | 81a4b2af4334a83eb026d13933fe04c440469a15 (patch) | |
tree | 06aa4b40734934f6ef194b48a86e1c1c6bc02e46 /zsh | |
parent | a52a730658403e7fdc51defeaabffc7856575459 (diff) |
Function for entering nix-shell with zsh shell and color
Diffstat (limited to 'zsh')
-rw-r--r-- | zsh/.zshrc | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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 +} |