dotfiles/.zshrc

138 lines
3.6 KiB
Bash

# Zgodovina ukazov
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=10000
# Vi zadeve, se mi zdi
bindkey -v
export KEYTIMEOUT=1
zstyle :compinstall filename '/home/g1smo/.zshrc'
autoload -Uz compinit
compinit
# Barve
autoload colors zsh/terminfo
colors
# BARVE!
export GREP_COLORS='1;32'
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
function man() {
LESS_TERMCAP_mb=$(printf "\e[1;35m") \
LESS_TERMCAP_md=$(printf "\e[1;34m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[7;40m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;33m") \
command man "$@"
}
function perldoc() { command perldoc -n less "$@" |man -l -; }
# Prompt za git
autoload -U promptinit
promptinit
autoload -Uz vcs_info
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' enable git svn hg
zstyle ':vcs_info:*' formats '(%b) '
precmd () {
vcs_info
}
setopt prompt_subst
PROMPT='%n@%m %1~ %{$fg[green]%}${vcs_info_msg_0_}%{$fg[blue]%}» %{$reset_color%}'
# Reverse search shortcut
bindkey '^R' history-incremental-pattern-search-backward
# Splosno barvanje zadev
[[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh
# CCCAMP 2019 fahrplan
#camp() {
# curl -s https://fahrplan.events.ccc.de/camp/2019/Fahrplan/schedule.json \
# | jq -r '.schedule.conference.days | .[] | select(.date=="'$(date +%F)'") | .rooms | .[] | .[] | select(.date|strptime("%Y-%m-%dT%H:%M:%S%z") > now) | "\(.start) \(.duration)|\(.room)|\(.title)"' \
# | sort -V | column -t -s'|'
#}
# Aliasi
alias ls='ls --color -C'
alias vi='vim'
alias sudo='sudo env PATH=$PATH '
alias grep="grep --color=auto"
alias ag="rg"
alias less="less -R"
alias gitclean="git fetch -p && for branch in \$(git branch -vv | grep ': gone]' | gawk '{print \$1}'); do git branch -D \$branch; echo 'deleted \$branch'; done"
alias sctl="systemctl"
alias ddrush="ddev exec drush"
alias dcomposer="ddev exec composer"
alias offer-files="python3 -m http.server"
# X on wayland
alias wxon="xhost +local:"
# RŠ aliasi
alias omnom="ssh root@debeli"
# Ljudmila
alias scdev="ssh culture@milci.ljudmila.org"
alias scnew="ssh culture@zala.ljudmila.org"
# Dolzina mp3 fajlov
alias mp3len="for i in \$(ls *.mp3); do echo \$i; soxi -d \$i; done"
# Hiter ping za net preverit
alias pg="ping 1.1.1.1"
# Najvecji fajli
alias najvecji="find . -printf '%s %p\n'| sort -nr | head -30"
# RŠ ssh
alias srs='f(){ ssh jurijp@$1.radiostudent.local };f'
alias srr='f(){ ssh root@$1.radiostudent.local };f'
alias rss='f(){ ssh jurijp@$1.radiostudent.si };f'
alias rsr='f(){ ssh root@$1.radiostudent.si };f'
alias zw="ssh zeljko@dev.radiostudent.si"
# Poslusaj snemanje
alias poslusaj='pactl load-module module-loopback latency_msec=1'
alias tisina='pactl unload-module module-loopback'
# PI ssh
alias spi='ssh pi@192.168.64.88'
# Na prostem sajt(i)
alias nps='cd ~/ljudmila/naprostem/sajt'
alias np='f(){ ssh root@$1.na-prostem.si };f'
# Kill element
alias kill-element='kill $(ps aux | grep element | awk '\''{print $2;}'\'')'
alias kill-zoom='pkill zoom'
alias nmc='nmcli con up '
# OBS fix
#alias obs="QT_QPA_PLATFORM=xcb obs"
# Build deb pkg
#alias deb-build="dpkg-buildpackage -us -uc"
alias deb-build="dpkg-buildpackage -b -rfakeroot -us -uc"
alias run-gamma="pkill -f gammastep; sleep 3; screen -dm -- gammastep -m wayland -l 46.05108:14.50513"
# Za LXD!
export PATH="${PATH}:$(go env GOPATH)/bin:/sbin:/usr/sbin"
export LD_LIBRARY_PATH="$(go env GOPATH)/deps/dqlite/.libs/:$(go env GOPATH)/deps/raft/.libs/:${LD_LIBRARY_PATH}"
# JS fix (prevec nov za openssl)
#export NODE_OPTIONS="--openssl-legacy-provider"