.dotfiles/.config/shellrc
2020-05-11 10:49:42 +02:00

123 lines
3.7 KiB
Bash

#
# ██ ██ ██
# ░██ ░██ ░██
# ██████░██ █████ ░██ ░██ ██████ █████
# ██░░░░ ░██████ ██░░░██ ░██ ░██░░██░░█ ██░░░██
# ░░█████ ░██░░░██░███████ ░██ ░██ ░██ ░ ░██ ░░
# ░░░░░██░██ ░██░██░░░░ ░██ ░██ ░██ ░██ ██
# ██████ ░██ ░██░░██████ ███ ███░███ ░░█████
# ░░░░░░ ░░ ░░ ░░░░░░ ░░░ ░░░ ░░░ ░░░░░
#~~~~~~~~~
# General
#~~~~~~~~~
source "$HOME/.profile"
#~~~~~~~~~
# Aliases
#~~~~~~~~~
# nvim
alias v='nvim'
alias vi='nvim'
alias vim='nvim'
alias nano='nvim'
alias emacs='nvim'
alias code='nvim'
alias suvi='sudo -E nvim'
# ls / tree
alias l='ls'
alias ll='ls -l'
alias la='ls -a'
alias lal='ls -al'
alias tr='tree -L 2'
# package managers
alias owo='pacman'
alias sowo='sudo pacman'
alias yay='yay --editmenu --nodiffmenu --save'
# youtube-dl
alias ytdl-audio='youtube-dl -i -f bestaudio -o "%(title)s.%(ext)s" -4'
alias ytdl-opus='youtube-dl -i --extract-audio --audio-format opus -o "%(title)s.%(ext)s" -4'
alias yt-video='youtube-dl -f bestvideo -o "%(title)s.%(ext)s" -4'
alias yt-thumbnail='youtube-dl --write-thumbnail --skip-download -o "%(title)s.%(ext)s" -4'
# git
alias btw='git --git-dir=$HOME/dev/botfiles/ --work-tree=$HOME'
alias ga='git add'
alias gc='git commit -S'
alias gp='git push'
alias gpom='git push origin master'
alias gch='git checkout'
alias gl='git log'
alias gpu='git pull'
alias gs='git status'
alias grm='git rm -f'
alias gi='git init'
# github-cli
alias gh-rc='gh repo create --public'
alias gh-rcp='gh repo create'
alias gh-rv='gh repo view'
# fzf
ff() { find ./* -type f | fzf | xargs -r $EDITOR ;}
fd() { vifm "$(find ./* -type d | fzf)" ; clear ; }
fhd() { find . -type d | fzf | xargs -r $EDITOR ; }
fhf() { find . -type f | fzf | xargs -r $EDITOR ; }
alias f='ff'
alias fa='fhf'
# other
alias s='sudo '
alias sudo='sudo '
alias pass='keepassxc-cli clip ~/Passwords/keepass.kdbx'
alias torrent='transmission-cli'
alias ascii='figlet'
alias mirrors='sudo reflector --latest 200 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist'
alias copy='xclip -selection clipboard'
alias battery='upower -i /org/freedesktop/UPower/devices/battery_BAT0'
alias c256='(x=`tput op` y=`printf %76s`;for i in {0..256};do o=00$i;echo -e ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${y// /=}$x;done)'
alias ...='cd ~/Dotfiles'
alias cd..='cd ..'
alias news='newsboat'
# 4fun
alias dog='cat'
alias nyancat='lolcat'
alias woman='man'
alias tak='yes'
#~~~~~~~~~~~~~~~~~
# Commands Colors
#~~~~~~~~~~~~~~~~~
alias ls='ls --color=auto'
alias ip='grc ip'
alias ping='grc ping'
alias ps='grc ps'
export SUDO_PROMPT="$(printf "\033[0;31m")[ sudo ]$(printf "\033[0m"): "
# man
man() {
LESS_TERMCAP_md=$'\e[01;31m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
# LESS_TERMCAP_so=$'\e[01;44;33m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[01;32m' \
command man "$@"
}
# less
export LESS=-R
export LESS_TERMCAP_mb=$'\E[1;31m' # begin blink
export LESS_TERMCAP_md=$'\E[1;36m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink
#export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline
export LESS_TERMCAP_ue=$'\E[0m' # reset underline
# vim: ft=sh