feat(zsh): update zsh config to use new options.

This commit is contained in:
CronyAkatsuki 2025-04-29 12:24:43 +02:00
parent 2cd8663cdf
commit ed58c47bf4

View File

@ -8,6 +8,32 @@
crony.zsh.enable = lib.mkEnableOption "Enable zsh and customize it."; crony.zsh.enable = lib.mkEnableOption "Enable zsh and customize it.";
}; };
imports = [
({lib, ...}: {
programs.zsh.initContent = lib.mkBefore ''
# Tmux autostart
if [ -x "$(command -v tmux)" ] && [ -n "$DISPLAY" ] && [ -z "$TMUX" ]; then
exec tmux new-session -A -s default >/dev/null 2>&1
fi
'';
})
({...}: {
programs.zsh.initContent = ''
${pkgs.nerdfetch}/bin/nerdfetch
# VI Mode escape timeout fix
export KEYTIMEOUT=1
# Substring search settings
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=blue,fg=black,bold"
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=black,bold'
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
[[ -f "$HOME/.config/zsh/functions.zsh" ]] && source "$HOME/.config/zsh/functions.zsh"
'';
})
];
config = lib.mkIf config.crony.zsh.enable { config = lib.mkIf config.crony.zsh.enable {
# Setup zsh # Setup zsh
programs.zsh = { programs.zsh = {
@ -35,27 +61,6 @@
vif = ''nvim $(fzf --preview="bat --color=always {}")''; vif = ''nvim $(fzf --preview="bat --color=always {}")'';
}; };
initExtra = ''
${pkgs.nerdfetch}/bin/nerdfetch
# VI Mode escape timeout fix
export KEYTIMEOUT=1
# Substring search settings
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=blue,fg=black,bold"
export HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=red,fg=black,bold'
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
[[ -f "$HOME/.config/zsh/functions.zsh" ]] && source "$HOME/.config/zsh/functions.zsh"
'';
initExtraFirst = ''
# Tmux autostart
if [ -x "$(command -v tmux)" ] && [ -n "$DISPLAY" ] && [ -z "$TMUX" ]; then
exec tmux new-session -A -s default >/dev/null 2>&1
fi
'';
antidote = { antidote = {
enable = true; enable = true;
plugins = [ plugins = [