simplify some things and remove some unused code

This commit is contained in:
xunuwu 2025-01-12 15:16:01 +01:00
parent 931efc7518
commit 6cf86a3827
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI
144 changed files with 251 additions and 3912 deletions

View file

@ -1,6 +1,4 @@
{config, ...}: {
programs.fzf.enable = true;
programs.zsh = {
enable = true;
autocd = true;
@ -11,6 +9,8 @@
history = {
expireDuplicatesFirst = true;
extended = true;
save = 100 * 1000;
path = "${config.xdg.dataHome}/zsh_history";
};
initExtra = ''
@ -41,13 +41,31 @@
## PROMPT ##
function preexec() {
timer=$(date +%s%3N)
}
function precmd_timer() {
if [ $timer ]; then
now=$(date +%s%3N)
elapsed=$(($now-$timer))
if [[ elapsed -gt 100 ]]; then
export RPROMPT="%F{cyan}''${elapsed}ms %f"
else
unset RPROMPT
fi
unset timer
fi
}
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
precmd_functions+=( precmd_vcs_info precmd_timer )
zstyle ':vcs_info:git:*' formats ' %b '
setopt prompt_subst
PROMPT="%F{blue}[%F{magenta}%n%F{blue}@%F{magenta}%M%F{blue}] %~%f %F{green}\$vcs_info_msg_0_%f%(?..%F{red}| %? )%#%f "
PROMPT='%F{blue}[%F{magenta}%n%F{blue}@%F{magenta}%M%F{blue}] %~%f %F{green}$vcs_info_msg_0_%f%(?..%F{red}| %? )%#%f '
'';
};
}