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:
parent
aa3374fba2
commit
77df84ade7
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue