Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.
| Порівняння попередніх версій Попередня ревізія Наступна ревізія | Попередня ревізія | ||
|
software:os:mac:install [2026/03/27 03:40] charon [Improve .zshrc] |
software:os:mac:install [2026/03/27 23:28] (поточний) charon [Zsh config] |
||
|---|---|---|---|
| Рядок 61: | Рядок 61: | ||
| brew " | brew " | ||
| brew " | brew " | ||
| + | brew " | ||
| brew " | brew " | ||
| + | brew " | ||
| brew " | brew " | ||
| brew " | brew " | ||
| Рядок 180: | Рядок 182: | ||
| </ | </ | ||
| Consider setting "Use ligatures" | Consider setting "Use ligatures" | ||
| + | |||
| + | ===== Zsh aliases ===== | ||
| + | Add next files to // | ||
| + | <file text my-aliases-common.zsh> | ||
| + | ### Common aliases | ||
| + | alias dir=" | ||
| + | alias l="ls -la" | ||
| + | if (( $+commands[eza] )); then | ||
| + | alias ls2=' | ||
| + | alias dir2=' | ||
| + | alias la2=' | ||
| + | alias ll2=' | ||
| + | alias tree2=' | ||
| + | fi | ||
| + | alias cls=" | ||
| + | alias cw=" | ||
| + | alias x=" | ||
| + | alias tree=" | ||
| + | alias bc="bc -ql" | ||
| + | alias tt=traceroute | ||
| + | alias ports=" | ||
| + | alias myip=" | ||
| + | alias weather=' | ||
| + | alias batcat=" | ||
| + | alias h='fc -li' | ||
| + | alias hg='fc -li | grep' | ||
| + | alias va=' | ||
| + | alias ve=' | ||
| + | alias list_instances=" | ||
| + | |||
| + | # Find top 5 big files | ||
| + | alias findbig=" | ||
| + | |||
| + | # To clear all the history and screen | ||
| + | alias hcl=' | ||
| + | |||
| + | # Make basic commands verbose | ||
| + | alias cp="cp -v" | ||
| + | alias rm="rm -v" | ||
| + | alias mv="mv -v" | ||
| + | |||
| + | # To navigate to the different directories | ||
| + | alias ..='cd ..' | ||
| + | alias ...=' | ||
| + | |||
| + | # Create and change to a new directory | ||
| + | mcd() { | ||
| + | if [[ -z " | ||
| + | echo " | ||
| + | return 1 | ||
| + | fi | ||
| + | mkdir -p " | ||
| + | } | ||
| + | |||
| + | # display currently mounted file systems nicely | ||
| + | showmounted() { (echo " | ||
| + | |||
| + | # Local aliases | ||
| + | alias gfo=" | ||
| + | alias zimdate=" | ||
| + | |||
| + | if (( $+commands[apg] )); then | ||
| + | alias apg1=" | ||
| + | alias apg2=" | ||
| + | alias apg3=" | ||
| + | fi | ||
| + | |||
| + | ######################################################################################### | ||
| + | ### OS-specific | ||
| + | case " | ||
| + | Darwin) | ||
| + | # Configuration if Brew installed | ||
| + | () { | ||
| + | local bp="" | ||
| + | [[ -x / | ||
| + | [[ -x / | ||
| + | |||
| + | if [[ -n " | ||
| + | export HOMEBREW_AUTO_UPDATE_SECS=86400 | ||
| + | export HOMEBREW_NO_ANALYTICS=1 | ||
| + | |||
| + | if (( $+commands[gls] )); then | ||
| + | # Using local variable for aliases | ||
| + | alias ls=" | ||
| + | alias date=" | ||
| + | alias findbig=" | ||
| + | else | ||
| + | [[ -t 1 ]] && echo " | ||
| + | fi | ||
| + | fi | ||
| + | } | ||
| + | |||
| + | alias openfinder=' | ||
| + | alias flushdns=' | ||
| + | alias cleanup=" | ||
| + | alias battery=" | ||
| + | alias play_alert=' | ||
| + | alias update=' | ||
| + | alias showfiles=' | ||
| + | alias hidefiles=' | ||
| + | alias localip=' | ||
| + | ;; | ||
| + | Linux) | ||
| + | alias ls='/ | ||
| + | alias bat='/ | ||
| + | alias monitor_turn_off=' | ||
| + | alias play_alert=' | ||
| + | alias psc=' | ||
| + | alias pss=' | ||
| + | alias update=' | ||
| + | alias update_download_only=' | ||
| + | alias update_small=' | ||
| + | alias pbcopy=" | ||
| + | alias findbig=" | ||
| + | ;; | ||
| + | esac | ||
| + | |||
| + | # Pictures (ZSH suffixes) | ||
| + | if [[ " | ||
| + | alias icat=" | ||
| + | elif [[ " | ||
| + | alias icat=" | ||
| + | elif [[ " | ||
| + | alias icat=" | ||
| + | else | ||
| + | alias icat=" | ||
| + | fi | ||
| + | |||
| + | alias -s png=" | ||
| + | alias -s jpg=" | ||
| + | alias -s jpeg=" | ||
| + | alias -s gif=" | ||
| + | alias -s bmp=" | ||
| + | alias -s webp=" | ||
| + | alias -s ico=" | ||
| + | # preview all images in current directory | ||
| + | icatdir() { | ||
| + | for img in *.{png, | ||
| + | echo "--- $img ---" | ||
| + | icat " | ||
| + | done | ||
| + | } | ||
| + | </ | ||
| + | alias nosleep=' | ||
| + | ===== Zsh config ===== | ||
| + | Add next files to // | ||
| + | <file text my-congif.zsh> | ||
| + | ########### | ||
| + | # History # | ||
| + | ########### | ||
| + | HISTFILE=$HOME/ | ||
| + | HISTSIZE=10000 | ||
| + | SAVEHIST=10000 | ||
| + | setopt EXTENDED_HISTORY | ||
| + | setopt SHARE_HISTORY | ||
| + | setopt HIST_IGNORE_DUPS | ||
| + | setopt HIST_IGNORE_SPACE | ||
| + | setopt HIST_REDUCE_BLANKS | ||
| + | setopt HIST_VERIFY | ||
| + | # Next is Oh-my-zsh specific | ||
| + | HIST_STAMPS=" | ||
| + | |||
| + | ######## | ||
| + | # MISC # | ||
| + | ######## | ||
| + | |||
| + | export EDITOR=vim | ||
| + | export VISUAL=vim | ||
| + | export LESS=" | ||
| + | |||
| + | case " | ||
| + | Darwin) | ||
| + | export GPG_TTY=$(tty) | ||
| + | path+=($HOME/ | ||
| + | ;; | ||
| + | Linux) | ||
| + | export SSH_ASKPASS=/ | ||
| + | export XDG_CONFIG_HOME=$HOME/ | ||
| + | export XDG_CACHE_HOME=$HOME/ | ||
| + | export XDG_DATA_HOME=$HOME/ | ||
| + | export XDG_STATE_HOME=$HOME/ | ||
| + | path+=(/ | ||
| + | ;; | ||
| + | esac | ||
| + | </ | ||
| + | |||
| + | ===== (Optional) Install NodeJS ===== | ||
| + | Install NodeJS: | ||
| + | brew install node@24 | ||
| + | check version, choose latest LTS: https:// | ||
| + | |||
| + | Configure directory for global packages: | ||
| + | mkdir -p ~/ | ||
| + | npm config set prefix ~/ | ||
| + | |||
| ===== Links ===== | ===== Links ===== | ||
| * [[https:// | * [[https:// | ||