Switch to Zsh as default shell
This commit is contained in:
parent
144458bb5d
commit
f7c94a461c
|
@ -110,6 +110,7 @@
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
group = "users";
|
group = "users";
|
||||||
description = "Evie Litherland-Smith";
|
description = "Evie Litherland-Smith";
|
||||||
|
shell = pkgs.zsh;
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"networkmanager"
|
"networkmanager"
|
||||||
"wheel"
|
"wheel"
|
||||||
|
@ -171,6 +172,7 @@
|
||||||
localBinInPath = true;
|
localBinInPath = true;
|
||||||
};
|
};
|
||||||
programs = {
|
programs = {
|
||||||
|
zsh.enable = true;
|
||||||
command-not-found.enable = false;
|
command-not-found.enable = false;
|
||||||
ssh.startAgent = true;
|
ssh.startAgent = true;
|
||||||
nano = {
|
nano = {
|
||||||
|
|
|
@ -21,6 +21,37 @@
|
||||||
# Shells
|
# Shells
|
||||||
bash.enable = true;
|
bash.enable = true;
|
||||||
nushell.enable = true;
|
nushell.enable = true;
|
||||||
|
zsh = {
|
||||||
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
autocd = true;
|
||||||
|
autosuggestion.enable = true;
|
||||||
|
defaultKeymap = "emacs";
|
||||||
|
syntaxHighlighting = {
|
||||||
|
enable = true;
|
||||||
|
highlighters = [
|
||||||
|
"brackets"
|
||||||
|
"cursor"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
historySubstringSearch.enable = true;
|
||||||
|
history = {
|
||||||
|
extended = true;
|
||||||
|
share = true;
|
||||||
|
ignoreDups = true;
|
||||||
|
ignoreAllDups = true;
|
||||||
|
ignoreSpace = true;
|
||||||
|
expireDuplicatesFirst = true;
|
||||||
|
};
|
||||||
|
initExtra = ''
|
||||||
|
## completion config and styling
|
||||||
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||||
|
zstyle ':completion:*' menu 'select=long-list'
|
||||||
|
|
||||||
|
## transient prompt
|
||||||
|
source ${./transient.zsh}
|
||||||
|
'';
|
||||||
|
};
|
||||||
# CLI programs and utilities
|
# CLI programs and utilities
|
||||||
btop.enable = true;
|
btop.enable = true;
|
||||||
carapace.enable = true;
|
carapace.enable = true;
|
||||||
|
|
31
system/home/shell/transient.zsh
Normal file
31
system/home/shell/transient.zsh
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
zle-line-init() {
|
||||||
|
emulate -L zsh
|
||||||
|
|
||||||
|
[[ $CONTEXT == start ]] || return 0
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
zle .recursive-edit
|
||||||
|
local -i ret=$?
|
||||||
|
[[ $ret == 0 && $KEYS == $'\4' ]] || break
|
||||||
|
[[ -o ignore_eof ]] || exit 0
|
||||||
|
done
|
||||||
|
|
||||||
|
local saved_prompt=$PROMPT
|
||||||
|
local saved_rprompt=$RPROMPT
|
||||||
|
PROMPT=' '
|
||||||
|
RPROMPT=''
|
||||||
|
zle .reset-prompt
|
||||||
|
PROMPT=$saved_prompt
|
||||||
|
RPROMPT=$saved_rprompt
|
||||||
|
|
||||||
|
if ((ret)); then
|
||||||
|
zle .send-break
|
||||||
|
else
|
||||||
|
zle .accept-line
|
||||||
|
fi
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
zle -N zle-line-init
|
Loading…
Reference in a new issue