cdotfis/dotfiles/.config/zsh/.aliases

97 lines
2.0 KiB
Bash

#!/bin/sh
alias mpvgui='mpv --player-operation-mode=pseudo-gui'
alias wget='wget --hsts-file="$XDG_DATA_HOME/wget-hsts"'
alias adb='HOME="$XDG_DATA_HOME"/android adb'
alias nvidia-settings='nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings'
alias ll='ls -l'
alias la='ls -al'
alias l='ls -CF'
alias lh='ls -lh'
alias vim='nvim'
alias svim='sudo nvim'
gacp() {
git add .
local var="$@"
if [ $(echo "$var" | wc -c) -gt 70 ]; then
echo "Maximum characters: 72"
return 1
fi
git commit -m "$var" -S
git push
}
gac() {
git add .
local var="$@"
if [ $(echo "$var" | wc -c) -gt 70 ]; then
echo "Maximum characters: 72"
return 1
fi
git commit -m "$var" -S
}
gcmp() {
local var="$@"
if [ $(echo "$var" | wc -c) -gt 70 ]; then
echo "Maximum characters: 72"
return 1
fi
git commit -m "$var" -S
git push
}
alias exiftcl='exiftool -all='
alias exift='exiftool'
alias upgraded='grep -i upgraded /var/log/pacman.log | tac | less'
alias installed='grep -i installed /var/log/pacman.log | tac | less'
alias mirrors='reflector --country Austria --protocol https --sort rate --save /etc/pacman.d/mirrorlist'
alias open='xdg-open $(fzf)'
alias o='xdg-open'
alias zat='zathura --fork'
alias trash-dir='cd $HOME/.local/share/Trash'
#alias fd='cd "$(dirname "$(fzf)")"'
alias val='valgrind --leak-check=full > valgrind.output 2>&1'
alias copy='xclip -selection clipboard'
function compile() {
sudo make clean && sudo make install
}
function rcomp() {
local file="${1//.rmd/}"
R -e "rmarkdown::render('$file.rmd', 'pdf_document')" && op $file.pdf
}
function fcd() {
local fd_options fzf_options target
fd_options=(
--hidden
--type directory
--exclude '.git'
)
fzf_options=(
--preview='tree -L 1 {}'
--bind=ctrl-space:toggle-preview
--exit-0
--keep-right
)
target="$(fd . "${1:-.}" "${fd_options[@]}" | fzf "${fzf_options[@]}")"
cd "$target" || return 1
}