diff --git a/env/.zshrc b/env/.zshrc index 68b148e..54421d3 100644 --- a/env/.zshrc +++ b/env/.zshrc @@ -1,32 +1,74 @@ +#!/bin/zsh -export ZSH="$HOME/.env/oh-my-zsh" +# Setup function, that resets terminal -ZSH_THEME="ivabus" -ENABLE_CORRECTION="true" -plugins=(git zsh-syntax-highlighting) - -# Function to quickly show stats on systemload, usage of filesystems, usage of ram/swap and uptime -stats () { - AVLD=$(cut -d " " -f1-3 /proc/loadavg) - USEDMEM=$(free -h | grep Mem | awk '{print $3 " / " $2}') - USEDSWAP=$(free -h | grep Swap | awk '{ print $3 " / " $2}') - USEDSTRG=$(df / -h | tail -n 1 | awk '{print $3}') - USEDSTRGPERC=$(df / -h | tail -n 1 | awk '{print $5}') - STRG=$(df / -h | tail -n 1 | awk '{print $2}') - USEDSTRGHOME=$(df /home -h | tail -n 1 | awk '{print $3}') - USEDSTRGPERCHOME=$(df /home -h | tail -n 1 | awk '{print $5}') - STRGHOME=$(df /home -h | tail -n 1 | awk '{print $2}') - UPTIME=$(uptime -p) - printf "\e[0;34msystem load:\e[m\t${AVLD}\n" - printf "\e[0;34musage of /:\e[m\t${USEDSTRGPERC}% (${USEDSTRG}/${STRG})\n" - printf "\e[0;34musage of /home:\e[m\t${USEDSTRGPERCHOME}% (${USEDSTRGHOME}/${STRGHOME})\n" - printf "\e[0;34mmemory usage:\e[m\t${USEDMEM}\n" - printf "\e[0;34mswap usage:\e[m\t${USEDSWAP}\n" - printf "\e[0;34muptime:\e[m\t\t${UPTIME}\n" +autoload -Uz add-zsh-hook +function reset_broken_terminal () { + printf '%b' '\e[0m\e(B\e)0\017\e[?5l\e7\e[0;0r\e8' } -source $ZSH/oh-my-zsh.sh -export REPORTTIME=10 +export ZSH="$HOME/.dotfiles/zsh" + +# Setup history + +HISTFILE="$HOME/.zsh_history" +HISTSIZE=10000 +SAVEHIST=10000 +bindkey '\e[A' history-search-backward +bindkey '\e[B' history-search-forward +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_FIND_NO_DUPS +setopt EXTENDED_HISTORY +setopt INC_APPEND_HISTORY +setopt SHARE_HISTORY +setopt APPEND_HISTORY +setopt HIST_NO_STORE + +REPORTTIME=3 + +autoload -Uz compinit bracketed-paste-magic url-quote-magic +compinit +zle -N bracketed-paste bracketed-paste-magic +zle -N self-insert url-quote-magic +zstyle ':completion:*' menu select + +# Source section + +source $HOME/.profile +source $ZSH/themes/ivabus.zsh-theme +source $ZSH/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + +# Alias section + alias vi="nvim" alias vim="nvim" +alias ls="ls --color=always" +alias la="ls -la" +alias rh="rehash" alias timestamp='date -u +%FT%TZ' +alias yt-dlp-opus="yt-dlp -f 251 -x" +alias jekyll_export="jekyll b -d ./_archive && cd _archive && tar cf ../site.tar ./ && cd .. && gzip -9 -f site.tar && rm -rf _archive" + +# ffmpeg section + +# Usage: ffmpeg_convert [] + +ffmpeg_convert() { + ffmpeg -i $2 -c:v ${1}_videotoolbox $(if [ ! -z $4 ]; then echo "-q:v $4"; fi ) $3 +} + +# Usage: ffmpeg_telegram_video_sticker: