myhome/.zshrc

141 lines
5.6 KiB
Bash
Raw Normal View History

# ZSHRC
CONFIG=$HOME/.config
2021-03-22 21:25:52 +01:00
parse_git_branch() {
command=$(git symbolic-ref --short HEAD 2> /dev/null)
[ -z $command ] && echo -e "$ " || echo -e "$(git symbolic-ref --short HEAD 2> /dev/null) $ "
}
gbranch() {
echo -e "$(git branch "$@")"
}
[ -f /etc/gentoo-release ] && export ZSH="/usr/share/zsh/site-contrib/oh-my-zsh"
[ -f /etc/centos-release ] && export ZSH="$HOME/.oh-my-zsh"
[ -f /etc/debian_version ] && export ZSH="$HOME/.oh-my-zsh"
[[ "$(uname)" == "Darwin" ]] && export ZSH="$HOME/.oh-my-zsh"
2021-03-22 21:25:52 +01:00
HISTFILE=$HOME/.history_zsh
HISTSIZE=10000
SAVEHIST=10000000
autoload -U colors && colors
setopt PROMPT_SUBST
PS1='%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~) $(parse_git_branch)%{$reset_color%}'
plugins=(rake ruby vagrant knife knife_ssh kitchen )
ZSH_DISABLE_COMPFIX=true
source $ZSH/oh-my-zsh.sh
[ ! -d $CONFIG/zsh/aws ] && { mkdir -p $CONFIG/zsh/aws ; cd $CONFIG/zsh ; git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ; git clone https://github.com/zsh-users/zsh-autosuggestions.git ; curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/aws/aws.plugin.zsh -o $CONFIG/zsh/aws/aws.plugin.zsh }
[ -d $CONFIG/zsh ] && source $CONFIG/zsh/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh &>> /dev/null
[ -d $CONFIG/zsh ] && source $CONFIG/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh &>> /dev/null
[ -d $CONFIG/zsh ] && source $CONFIG/zsh/aws/aws.plugin.zsh &>> /dev/null
[ -f $HOME/.password ] && source $HOME/.password
[ ! -d $CONFIG/fzf ] && git clone https://github.com/junegunn/fzf.git $HOME/.config/fzf
[ -f $CONFIG/fzf/shell/key-bindings.zsh ] && source $HOME/.config/fzf/shell/key-bindings.zsh
2021-03-22 21:25:52 +01:00
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
FPATH=/usr/local/share/zsh/site-functions:$FPATH
export GPG_TTY=$(tty)
2021-12-19 00:55:34 +01:00
# export TERM=xterm-256color
export TERM=screen-256color
2021-03-22 21:25:52 +01:00
export SHELL=/bin/bash
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
export _JAVA_AWT_WM_NONREPARENTING=1
export CCACHE_DIR="/usr/ccache"
export LC_ALL="en_US.UTF-8"
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export BROWSER=/home/yorune/.local/bin/browser-x
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse'
export EIX_LIMIT_COMPACT=0
export TERMINAL="st"
export QT_SCALE_FACTOR=1.5
export VISUAL='nvim'
export EDITOR='nvim'
alias vimc="nvim $HOME/.vimrc"
alias svm="sudo nvim /etc/portage/make.conf"
alias svr="sudo nvim /etc/portage/repos.conf"
alias svp="sudo nvim /etc/portage/package.use"
alias sva="sudo nvim /etc/portage/package.accept_keywords"
2021-03-22 21:25:52 +01:00
alias emerge="sudo emerge"
alias channel-check='sudo iwlist wlan0 scan | egrep -i "essid|frequency"'
2022-03-05 17:23:54 +01:00
alias grep="grep"
alias egrep="egrep"
2021-09-15 20:12:28 +02:00
[[ "$(uname)" == "Darwin" ]] && alias ls="ls -Gh" || alias ls="ls -h --color=auto"
2021-03-22 21:25:52 +01:00
alias ll='ls -lha'
alias cp='cp -v'
alias mv='mv -v'
alias myip="curl ipinfo.io/ip"
alias logi="journalctl -f"
alias pl="setxkbmap pl"
alias graphic-card="glxinfo|egrep 'OpenGL vendor|OpenGL renderer'"
alias mylaptop-components="inxi -Fxz"
alias r="ranger"
alias v="nvim"
2021-08-08 17:41:57 +02:00
alias feh="feh --edit --scale-down"
2021-03-22 21:25:52 +01:00
alias changefont="figlet"
alias gmaster="git checkout master"
alias gcommit="git commit --author='Marcin Woźniak <y0rune@aol.com>' -s"
alias gcommitw="git commit --author='Marcin Wozniak <marcin.wozniak@wundermanthompson.com>'"
2021-03-22 21:25:52 +01:00
alias gdel="git push origin --delete"
alias gadd="git add"
alias gpush="git push"
2022-02-22 14:38:44 +01:00
alias gpull="git pull; git submodule foreach git pull origin master; git submodule foreach git pull origin main"
2021-03-22 21:25:52 +01:00
alias gstatus="git status -s"
alias gst="git status -s"
alias gdiff="git diff"
alias gnew="git checkout -b"
alias glog="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches"
alias cal="cal -3"
alias code="vscodium-bin"
alias vpn="sudo /root/.local/bin/protonvpn c -f"
alias vpnch="sudo /root/.local/bin/protonvpn c --cc CH"
alias vpnd="sudo /root/.local/bin/protonvpn d"
alias tv="~/MEGA/tv/tv.sh"
alias newswork="newsboat --url=$HOME/.config/newsboat/urlswork"
alias vim="nvim -p"
2021-03-22 21:25:52 +01:00
alias denpl="trans en:pl"
alias dplen="trans pl:en"
alias notes="nvim $HOME/git/notes/index.md"
alias mgr="cd $HOME/Documents/Mega-Documents/Magisterka-Marcin/Semestr1/"
2021-11-24 15:52:00 +01:00
[[ "$(uname)" == "Darwin" ]] && alias mpv="mpv --no-resume-playback" || alias mpv="__NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 __GLX_VENDOR_LIBRARY_NAME=nvidia __GL_SYNC_TO_VBLANK=0 mpv --vo=x11 --hwdec=no --ytdl-raw-options="yes-playlist=" --no-resume-playback --ytdl-format='bestvideo[height<=?1080]+bestaudio/best'"
2021-03-22 21:25:52 +01:00
alias aria2c="aria2c --seed-time=0 --disable-ipv6 --max-upload-limit=1k"
2021-06-19 16:47:30 +02:00
alias lg="lazygit"
alias update-brew="brew upgrade --cask"
2021-10-23 22:10:39 +02:00
alias cl="cd $HOME/Documents/Collage/Semestr2"
2021-12-12 10:18:52 +01:00
alias irc="ssh mikrus -t 'screen -r'"
2022-03-05 17:24:02 +01:00
alias rsync="rsync --progress"
2021-03-22 21:25:52 +01:00
# Cleaning-up
export PATH=$HOME/.local/bin:$PATH
export PATH=/sbin:$PATH
2021-09-29 20:17:26 +02:00
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
[ -d $HOME/repo/fortigate/bin ] && export PATH=$HOME/repo/fortigate/bin:$PATH
2021-03-22 21:25:52 +01:00
export HISTTIMEFORMAT="%F %T "
2022-01-06 01:02:25 +01:00
# Export for Mac
if [[ "$(uname)" == "Darwin" ]]; then
export PATH="/usr/local/opt/openssl@3/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"
alias lsblk="diskutil list"
alias Update="brew update; brew upgrade"
# Resolve problem with GOPATH
# https://stackoverflow.com/questions/66284870/go-get-not-downloading-to-src-folder
export GO111MODULE=off
fi
2022-02-22 11:18:32 +01:00
# Resolve problem with
# zsh: no matches found
setopt +o nomatch