2020-08-09 22:59:14 +00:00
|
|
|
function define_aliases -a uname -d 'Defines aliases for commonly used commands'
|
2020-10-31 22:13:25 +00:00
|
|
|
alias rcp 'rsync -aP'
|
2020-08-09 22:59:14 +00:00
|
|
|
alias dm 'docker-machine'
|
2020-10-31 22:13:25 +00:00
|
|
|
alias v 'nvim +FZF'
|
2020-08-09 22:59:14 +00:00
|
|
|
alias vg 'vagrant'
|
|
|
|
alias tf 'terraform'
|
|
|
|
alias tocb 'xclip -in -selection clipboard'
|
|
|
|
alias fromcb 'xclip -out -selection clipboard'
|
2020-10-31 22:13:25 +00:00
|
|
|
alias ssh-rm 'ssh-keygen -f ~/.ssh/known_hosts -R'
|
2020-08-11 16:16:26 +00:00
|
|
|
alias wiki 'nvim +VimwikiIndex'
|
2020-10-31 22:13:25 +00:00
|
|
|
alias age-p 'age --armor --passphrase'
|
|
|
|
alias age-d 'age --decrypt --identity ~/.secrets/id_ed25519'
|
|
|
|
alias age-e 'age --armor --recipient (cat ~/.secrets/id_ed25519.pub)'
|
|
|
|
alias age-k 'age --decrypt --identity ~/.secrets/id_ed25519 ~/.secrets/age_keys.age'
|
2020-08-09 22:59:14 +00:00
|
|
|
|
|
|
|
switch "$uname"
|
|
|
|
case 'Linux'
|
2020-10-31 22:13:25 +00:00
|
|
|
alias goland 'command goland'
|
|
|
|
alias rider 'command rider'
|
2020-08-09 22:59:14 +00:00
|
|
|
alias webstorm 'command webstorm'
|
2020-10-31 22:13:25 +00:00
|
|
|
alias sctl 'sudo systemctl'
|
2021-01-19 05:41:16 +00:00
|
|
|
alias uctl 'systemctl --user'
|
2021-03-11 23:31:46 +00:00
|
|
|
alias bctl 'bluetoothctl'
|
2020-08-09 22:59:14 +00:00
|
|
|
case 'Darwin'
|
2020-10-31 22:13:25 +00:00
|
|
|
alias goland 'open -a Goland'
|
|
|
|
alias rider 'open -a Rider'
|
2020-08-09 22:59:14 +00:00
|
|
|
alias webstorm 'open -a Webstorm'
|
2021-02-01 00:36:23 +00:00
|
|
|
|
|
|
|
alias get 'brew install'
|
|
|
|
alias getu 'brew upgrade'
|
|
|
|
alias gets 'brew search'
|
|
|
|
alias getr 'brew uninstall'
|
2020-08-09 22:59:14 +00:00
|
|
|
end
|
2021-01-19 05:41:16 +00:00
|
|
|
|
|
|
|
# Linux distro specific aliases below
|
|
|
|
|
|
|
|
set -l distro
|
|
|
|
|
|
|
|
for line in (cat /etc/os-release)
|
|
|
|
set -l items (string split --max 1 '=' $line)
|
|
|
|
|
|
|
|
if test $items[1] = 'ID'
|
|
|
|
set distro $items[2]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
switch "$distro"
|
|
|
|
case 'arch'
|
2021-02-01 00:36:23 +00:00
|
|
|
alias get 'pikaur -S'
|
2021-01-19 05:41:16 +00:00
|
|
|
alias getu 'pikaur -Syu'
|
|
|
|
alias gets 'pikaur'
|
|
|
|
alias getr 'pikaur -Rsu'
|
|
|
|
case 'debian'
|
|
|
|
alias get 'sudo apt update; and sudo apt install'
|
2021-02-01 00:36:23 +00:00
|
|
|
alias getu 'sudo apt update; and sudo apt upgrade; and sudo apt autoremove; and sudo apt autoclean'
|
2021-01-19 05:41:16 +00:00
|
|
|
alias gets 'sudo apt update; and apt search'
|
|
|
|
|
|
|
|
function getr -d 'Alias for apt uninstall and autoremove'
|
|
|
|
sudo apt purge $argv; and sudo apt autoremove
|
|
|
|
end
|
|
|
|
end
|
2020-08-09 22:59:14 +00:00
|
|
|
end
|