Ensure proper environment when using nsz

I have an alias nsz which runs a nix-shell with zsh.
But the $SHELL is still bash.

I now change the SHELL variable in order to use my expected shell in all
circumstances.
I also ensure neovim will use zsh for commands as some of my auto
commands expect this shell for expansion of **.
This commit is contained in:
Daniel Siepmann 2024-02-20 08:09:35 +01:00
parent aa3374fba2
commit 77df84ade7
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
2 changed files with 5 additions and 0 deletions

View file

@ -49,6 +49,7 @@ nix_subshell () {
# check for IN_NIX_SHELL
if [[ "$IN_NIX_SHELL" ]]; then
prompt_color="yellow"
export SHELL=$(which zsh)
fi
}
add-zsh-hook precmd nix_subshell

View file

@ -46,3 +46,7 @@ set scrolloff=1000
" Custom highlighting
match Todo /TODO\|NOTE\|todo\|TASK/
match ERROR /♥/
" As I sometimes open neovim inside a nix-shell where default SHELL is bash instead of zsh.
" This would break some of my autocommands using ** expansion.
set shell=zsh