Only initialize OS-specific shell aliases on the target OS

This commit is contained in:
2020-05-03 16:00:46 +01:00
parent 57bd402736
commit 75ec8125d9
3 changed files with 14 additions and 10 deletions

View File

@@ -3,7 +3,6 @@
#
# System
alias o="open"
alias s="ssh"
alias ec="echo"
alias ls="ls -B"
@@ -41,15 +40,11 @@ if (( $+commands[flutter] )); then
alias fl="flutter"
fi
# Flush DNS cache
alias flush_dns="dscacheutil -flushcache"
# Misc.
alias weechat="TERM=screen-256color weechat-curses"
alias slashdot="ab -kc 50 -t 300"
alias digg="ab -kc 50 -t 30"
alias fact="elinks -dump randomfunfacts.com | sed -n '/^| /p' | tr -d \|"
alias netlisteners='lsof -i -Pn | grep LISTEN'
alias servethis="python -c 'import SimpleHTTPServer; SimpleHTTPServer.test()'"
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'''
alias fku="fuck you"
@@ -80,11 +75,6 @@ mcd() {
mkdir -p "$1" && cd "$1";
}
# Open man page in Preview.
pman () {
man -t "${1}" | open -f -a /Applications/Preview.app
}
# Extract most common archives with single command.
# - from: http://alias.sh/extract-most-know-archives-one-command
extract() {

View File

@@ -2,5 +2,8 @@
# Linux specific setup
#
# Aliases
alias o="xdg-open"
# Ensure 256 color support in Linux
export TERM="xterm-256color"

View File

@@ -2,6 +2,17 @@
# macOS Specific
#
# Aliases
alias o="open"
# Flush DNS cache
alias flush_dns="dscacheutil -flushcache"
# Open man page in Preview.
pman () {
man -t "${1}" | open -f -a /Applications/Preview.app
}
# Fix wifi issues on OS X 10.10.x Yosemite.
# - from: https://medium.com/@mariociabarra/wifried-ios-8-wifi-performance-issues-3029a164ce94
alias fix_wifi="sudo ifconfig awdl0 down"