sypher_01

my zsh shell

Jun 26th, 2024
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.00 KB | Source Code | 0 0
  1. # Enable color support
  2. autoload -U colors && colors
  3.  
  4. # Set the prompt
  5. PROMPT='%F{white}╰─λ %F{white}'
  6. RPROMPT=''
  7.  
  8. # Function to calculate command execution time
  9. precmd() {
  10.   elapsed_time=$(( ($(date +%s%3N) - cmd_start_time) ))
  11.   PS1="%F{red}╭─%n@%m %F{magenta}%~ took ${elapsed_time}ms
  12. %F{white}╰─λ %F{white}"
  13. }
  14.  
  15. preexec() {
  16.   cmd_start_time=$(date +%s%3N)
  17. }
  18.  
  19. # Enable auto-correction
  20. setopt CORRECT
  21.  
  22. # Enable command auto-completion
  23. autoload -U compinit && compinit
  24.  
  25. # Enable extended globbing and regular expressions
  26. setopt EXTENDED_GLOB
  27.  
  28. # History settings
  29. HISTFILE=~/.zsh_history
  30. HISTSIZE=1000
  31. SAVEHIST=1000
  32. setopt APPEND_HISTORY
  33. setopt INC_APPEND_HISTORY
  34. setopt SHARE_HISTORY
  35. setopt HIST_IGNORE_ALL_DUPS
  36. setopt HIST_FIND_NO_DUPS
  37.  
  38. # Aliases
  39. alias ll='ls -lah'
  40. alias ..='cd ..'
  41. alias ...='cd ../..'
  42.  
  43. # Load custom scripts if they exist
  44. if [ -d "$HOME/.zshrc.d" ]; then
  45.   for file in "$HOME/.zshrc.d"/*.zsh; do
  46.     [ -r "$file" ] && source "$file"
  47.   done
  48. fi
  49.  
Tags: zsh zshrc
Add Comment
Please, Sign In to add comment