2023-08-05 18:08:48 +02:00
|
|
|
# vim: set ft=bash :
|
|
|
|
|
2023-05-21 19:16:51 +02:00
|
|
|
# Alias aliases
|
|
|
|
alias al=alias
|
|
|
|
alias alf="alias | fzf"
|
|
|
|
alias al-=unalias
|
2021-12-31 12:43:26 +01:00
|
|
|
|
2023-05-21 19:17:14 +02:00
|
|
|
# Edit configuration files
|
|
|
|
alias eba="nvim ~/.bashrc"
|
|
|
|
alias eal="nvim ~/.bash_aliasrc"
|
2024-09-29 11:36:20 +02:00
|
|
|
alias ev="edit_editor_config"
|
2020-04-07 22:24:30 +02:00
|
|
|
|
2021-02-16 21:15:23 +01:00
|
|
|
# Navigation
|
2024-12-14 16:33:37 +01:00
|
|
|
|
2020-05-07 02:09:35 +02:00
|
|
|
alias ..="cd .."
|
2021-02-16 21:15:23 +01:00
|
|
|
alias .2="cd ../.."
|
|
|
|
alias .3="cd ../../.."
|
2020-05-07 02:09:35 +02:00
|
|
|
|
2020-08-18 18:22:50 +02:00
|
|
|
# Colorize output
|
2020-04-07 22:24:30 +02:00
|
|
|
alias ls="ls --color=auto"
|
|
|
|
alias grep="grep --color=auto"
|
2021-12-31 12:43:26 +01:00
|
|
|
alias ip="ip --color"
|
|
|
|
|
|
|
|
# Listing
|
2022-05-11 00:43:33 +02:00
|
|
|
alias l="ls -1p"
|
|
|
|
alias ll="ls -lhp"
|
|
|
|
alias lt="ls -lhtp"
|
|
|
|
alias la="ls -lhap"
|
|
|
|
alias lta="ls -lhatp"
|
2022-05-12 09:32:07 +02:00
|
|
|
alias ldir="ls -dp" # list directories
|
2020-12-03 12:00:52 +01:00
|
|
|
|
|
|
|
# Safety
|
2021-12-31 12:43:26 +01:00
|
|
|
alias rm="rm -I --preserve-root"
|
|
|
|
alias mv="mv -iv"
|
|
|
|
alias cp="cp -iv"
|
|
|
|
alias ln="ln -i"
|
|
|
|
alias mkdir="mkdir -pv"
|
|
|
|
alias chown="chown --preserve-root"
|
|
|
|
alias chmod="chmod --preserve-root"
|
|
|
|
alias chgrp="chgrp --preserve-root"
|
|
|
|
|
2021-04-25 00:24:50 +02:00
|
|
|
# Clipboard
|
2022-05-11 00:43:33 +02:00
|
|
|
alias clip="xclip -sel clip"
|
|
|
|
alias srclip="clip -o | speedread -w 500"
|
2020-12-03 12:00:52 +01:00
|
|
|
|
2021-12-31 12:43:26 +01:00
|
|
|
# Other
|
2023-05-01 15:35:18 +02:00
|
|
|
alias cfg="/usr/bin/git --git-dir=/home/h/.git/ --work-tree=/home/h"
|
2022-05-11 00:43:33 +02:00
|
|
|
alias df="df -kTh"
|
2020-05-07 02:09:35 +02:00
|
|
|
alias fzfpac="pacman -Slq | fzf -m --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S"
|
2023-05-15 13:59:40 +02:00
|
|
|
alias path='echo -e ${PATH//:/\\n}' # Pretty print path variables
|
2020-05-07 02:09:35 +02:00
|
|
|
|
2021-12-31 12:43:26 +01:00
|
|
|
# Programs
|
2023-05-15 14:00:41 +02:00
|
|
|
alias o="xdg-open"
|
2022-12-01 16:13:46 +01:00
|
|
|
alias v="nvim"
|
2021-12-31 12:43:26 +01:00
|
|
|
alias g='git'
|
2023-05-15 14:00:41 +02:00
|
|
|
alias t=' task'
|
|
|
|
alias tsh='tasksh'
|
|
|
|
alias z='zathura --fork'
|
|
|
|
alias f='fzf'
|
|
|
|
alias fm='pcmanfm &>/dev/null &'
|
2022-05-11 00:43:33 +02:00
|
|
|
alias xev='xev | grep -A2 ButtonPress' # Ignore mouse movements
|
2023-08-05 18:08:48 +02:00
|
|
|
alias mm='micromamba'
|
2020-05-07 16:08:53 +02:00
|
|
|
|
2023-05-15 14:00:41 +02:00
|
|
|
# Languages
|
|
|
|
alias js="node"
|
|
|
|
alias ts="ts-node"
|
|
|
|
alias r5="plt-r5rs --no-prim"
|
|
|
|
alias hs="ghci"
|
|
|
|
alias pl="swipl"
|
|
|
|
alias py="python"
|
|
|
|
alias r="R"
|
|
|
|
|
|
|
|
alias azerty="setxkbmap be"
|
|
|
|
alias qwerty="setxkbmap us"
|
2023-08-05 18:08:48 +02:00
|
|
|
alias cole="setxkbmap us -variant colemak"
|
2024-12-14 16:33:37 +01:00
|
|
|
|
|
|
|
yarn() {
|
|
|
|
if [[ -f "package-lock.json" ]]; then
|
|
|
|
echo "WARNING: package-lock.json exists"
|
|
|
|
read -p "Are you sure you want to run yarn? [y/N] " -n 1 -r
|
|
|
|
echo
|
|
|
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
|
|
command yarn "$@"
|
|
|
|
else
|
|
|
|
echo "Aborted"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
command yarn "$@"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
npm() {
|
|
|
|
if [[ -f "yarn.lock" ]]; then
|
|
|
|
echo "WARNING: yarn.lock exists"
|
|
|
|
read -p "Are you sure you want to run npm? [y/N] " -n 1 -r
|
|
|
|
echo
|
|
|
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
|
|
command npm "$@"
|
|
|
|
else
|
|
|
|
echo "Aborted"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
command npm "$@"
|
|
|
|
fi
|
|
|
|
}
|