Marty Oehme
d5b7646611
Fixes tmux session function alias and renames function to be a bit more descriptive. Added basic `md` alias to recursively `mkdir` directories.
60 lines
1.2 KiB
Bash
60 lines
1.2 KiB
Bash
#!/usr/bin/env sh
|
|
#
|
|
# Global aliases for any shell
|
|
|
|
exist() { type "$1" >/dev/null 2>&1; }
|
|
|
|
# Avoid aliases which I did not create -- unalias EVERYTHING
|
|
unalias -a
|
|
|
|
# v shorthand for neovim
|
|
alias v="nvim"
|
|
|
|
# exit shell mimicks vim
|
|
alias :q="exit"
|
|
|
|
# ls defaults
|
|
if exist exa; then
|
|
alias l="exa -l --git --git-ignore"
|
|
alias L="exa -hal --grid --git"
|
|
# a recursive tree
|
|
# - usually want to change levels recursed with -L2 -L3 or similar
|
|
alias ll="exa --tree -L2"
|
|
alias LL="exa -a --tree -L2"
|
|
else
|
|
alias l="ls -lhF"
|
|
alias L="ls -lAhF"
|
|
fi
|
|
|
|
# cd defaults
|
|
alias ..="cd .."
|
|
alias ...="cd ../.."
|
|
alias ~="cd ~"
|
|
|
|
alias md="mkdir -p"
|
|
|
|
# clear my screen
|
|
alias cl="clear"
|
|
|
|
# Display current external ip address
|
|
alias myip="curl -s icanhazip.com"
|
|
|
|
# fzf
|
|
if exist fzf; then
|
|
# Display fuzzy-searchable history
|
|
alias fzf_history="history | fzf --tac --height 20"
|
|
# Fuzzy search packages to install
|
|
if exist yay; then
|
|
alias fzf_yay="yay -Slq | fzf -m --preview 'yay -Si {1}' | xargs -ro yay -S"
|
|
# Fuzzy uninstall packages
|
|
alias fzf_yayrns="yay -Qeq | fzf -m --preview 'yay -Qi {1}' | xargs -ro yay -Rns"
|
|
fi
|
|
fi
|
|
|
|
# vifm
|
|
if exist vifm; then
|
|
alias vm=vifm
|
|
alias vmm='vifm ${PWD}'
|
|
# enable picture preview script
|
|
exist vifmrun && alias vifm=vifmrun
|
|
fi
|