Користувальницькькі налаштування

Налаштування сайту


software:os:terminal:wezterm

Розбіжності

Тут показані розбіжності між вибраною ревізією та поточною версією сторінки.

Посилання на цей список змін

Порівняння попередніх версій Попередня ревізія
Наступна ревізія
Попередня ревізія
software:os:terminal:wezterm [2026/03/09 13:47]
charon [MacOS]
software:os:terminal:wezterm [2026/03/09 18:59] (поточний)
charon [Убунту]
Рядок 50: Рядок 50:
   # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.   # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
   [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh   [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
-   +А на самий початок ~/.zshrc додати: 
-===== Додаткові налаштування Zsh =====+<code> 
 +# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. 
 +# Initialization code that may require console input (password prompts, [y/n] 
 +# confirmations, etc.) must go above this block; everything else may go below. 
 +if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 
 +  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 
 +fi 
 +</code> 
 + 
 +===== Додаткові налаштування Zsh: Аліаси ===== 
 +основна ідея в тому, щоб покласти файли з розширенням //.zsh// в каталог //~/.oh-my-zsh/custom// 
 +==== Усі ==== 
 +<file zsh my-aliases.zsh> 
 +alias dir="ls -a" 
 +alias l="ls -la" 
 +alias cw="clear; w" 
 +alias x="exit" 
 +alias cls="clear" 
 +alias bc="bc -ql" 
 +alias tt=traceroute 
 +alias ports="sudo netstat -luntp" 
 +alias play_alert="afplay ~/Sync/music/effects/Train\ Fx\ 2.wav" 
 +alias myip="wget -O - -q icanhazip.com" 
 +alias batcat="bat" 
 +alias va='source ./venv/bin/activate' 
 +alias ve='python3 -m venv ./venv' 
 +alias list_instances="aws ec2 describe-instances --no-cli-pager --color off --filter Name=tag-key,Values=Name Name=instance-state-name,Values=running --query 'Reservations[*].Instances[*].{Instance_Id:InstanceId,Type:InstanceType,Public_IP:PublicIpAddress,Private_IP:PrivateIpAddress,SSH_Key:KeyName,Name:Tags[?Key==\`Name\`]|[0].Value}' --output table" 
 + 
 +# Find top 5 big files 
 +alias findbig="find . -type f -exec ls -s {} \; | sort -n -r | head -5" 
 + 
 +# To clear all the history and screen 
 +alias hcl='history -c; clear' 
 + 
 +# 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 ...='cd ../..' 
 + 
 +# Create and change to a new directory 
 +mcd () 
 +
 +   if [ "$1" == "" ]; then 
 +       echo "mcd directory-name"; 
 +   else 
 +       if [ ! -d $1 ]; then 
 +           mkdir $1; 
 +           cd $1; 
 +       else 
 +           echo "$1 directory exists"; 
 +       fi; 
 +   fi 
 +
 +# display currently mounted file systems nicely 
 +showmounted() { (echo "DEVICE PATH TYPE FLAGS" && mount | awk '$2=$4="";1') | column -t; } 
 + 
 +# Local aliases 
 +alias gfo="git fetch origin && git status" 
 +alias zimdate="LC_TIME=en_US.UTF-8 date '+Week %V%n%A, %d.%m.%Y'" 
 + 
 +alias apg1="apg -a 0 -n 1 -m 8 -x 10 -M NCL -E I1l0O" 
 +alias apg2="apg -a 0 -n 1 -m 14 -x 16 -M NCL -E I1l0O" 
 +alias apg3="apg -a 0 -n 1 -m 14 -x 16 -M NCLS -E I1l0O" 
 +</file> 
 + 
 +==== MacOS ==== 
 +<file zsh my-aliases.zsh> 
 +# Exit if it's not MacOS 
 +[[ "$(uname -s)" != "Darwin" ]] && return 
 + 
 +# Configuration if Brew installed 
 +() { 
 +    local bp="" 
 +    [[ -x /opt/homebrew/bin/brew ]] && bp="/opt/homebrew" 
 +    [[ -x /usr/local/bin/brew ]] && bp="/usr/local" 
 + 
 +    if [[ -n "$bp" ]]; then 
 +        export HOMEBREW_AUTO_UPDATE_SECS=86400 
 +        export HOMEBREW_NO_ANALYTICS=1 
 + 
 +        if (( $+commands[gls] )); then 
 +            # Використовуємо локальну змінну для аліасів 
 +            alias ls="$bp/bin/gls --color=never -F --group-directories-first" 
 +            alias date="$bp/bin/gdate" 
 +        else 
 +                [[ -t 1 ]] && echo "\e[33mNotice:\e[0m Coreutils not found. Run: brew install coreutils" 
 +        fi 
 +    fi 
 +
 + 
 +alias openfinder='open -a Finder $1' 
 +alias flushdns='sudo dscacheutil -flushcache' 
 +alias cleanup="find . -type f -name '*.DS_Store' -ls -delete" # This alias will find and delete all ".DS_Store" files in the current directory and all subdirectories. 
 +alias battery="pmset -g batt | grep -Eo '[0-9]+%' | sed 's/%//'" 
 +</file> 
 + 
 +==== Убунту ==== 
 +<file zsh my-aliases-ubuntu.zsh> 
 +alias ls='/bin/ls --color=never -F --group-directories-first' 
 +alias pbcopy="$HOME/scripts/stub_pbcopy.sh" 
 +alias monitor_turn_off='xset dpms force off' 
 +alias play_sound='aplay ~/Music/effects/Train\ Fx\ 2.wav' 
 +alias psc='ps xawf -eo pid,user,cgroup,args' 
 +alias pss='systemd-cgls' 
 +alias tree='tree -C --dirsfirst' 
 + 
 +if [[ -f /etc/os-release ]]; then 
 +        if grep -q "^ID=ubuntu$" /etc/os-release; then 
 +                alias update="$HOME/scripts/update.sh" 
 +                alias update_small="sudo apt upgrade --assume-yes" 
 +                alias update_download_only="sudo apt update && sudo apt upgrade --download-only --assume-yes" 
 +        elif grep -q "^ID=debian$" /etc/os-release; then 
 +                alias update="sudo apt update && sudo apt upgrade --assume-yes" 
 +                alias update_download_only="sudo apt update && sudo apt upgrade --download-only --assume-yes" 
 +        fi 
 +fi 
 +</file> 
 ==== MacOS ==== ==== MacOS ====
 додамо корисні плагіни zsh-autosuggestions zsh-syntax-highlighting додамо корисні плагіни zsh-autosuggestions zsh-syntax-highlighting
Рядок 61: Рядок 182:
 </code> </code>
 можливо, щось аналогічне треба зробити й для Лінукс можливо, щось аналогічне треба зробити й для Лінукс
 +
 +==== Для всіх ====
 +відкрити ~/.zshrc
 +<code>
 +plugins=(
 +  git
 +  terraform
 +  direnv
 +  z
 +  zsh-autosuggestions
 +  zsh-syntax-highlighting
 +)
 +</code>
 +можна додати й інші плагіни, але обережно, це гальмує запуск терміналу
 +
 +Щоб додати аліаси та інше, треба створити файл //${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/my-aliases.zsh// (ім'я на свій смак) і в нього додати:
 +
 ===== Посилання ===== ===== Посилання =====
  * [[https://wezterm.org/|WezTerm]] official site  * [[https://wezterm.org/|WezTerm]] official site
software/os/terminal/wezterm.1773056863.txt.gz · Востаннє змінено: 2026/03/09 13:47 повз charon