dotfiles-old/zsh_aliases

139 lines
4.3 KiB
Plaintext
Raw Normal View History

2023-06-02 12:18:46 -05:00
### Custom Alias File
2023-04-07 18:42:12 -05:00
## sourced by .zshrc
alias cp="cp -i" # Confirm before overwriting something
alias df='df -h' # Human-readable sizes
alias free='free -m' # Show sizes in MB
### Check on free space and overgrowing files
alias freespace="sudo du -h /* --exclude={'proc','run'}| sort -hr | less"
### Get system info via inxi [use -z for private filters]
alias sysinfo="sudo inxi -FdfiJlmopru -W 75013 -xxx -t && echo -e ' \n' && systemd-analyze"
### EXA
export EXA_COLORS="uu=38;5;42:di=38;5;33:fi=38;5;183:ex=38;5;125:sn=38;5;13:sb=38;5;13:uw=38;5;91:gw=38;5;91:tw=38;5;91:ur=38;5;11:gr=38;5;11:tr=38;5;11:ux=38;5;42:gx=38;5;42:tx=38;5;42:ue=38;5;42"
export EXA_ICON_SPACING=1
alias ls='exa --icons --color always' # ls
alias ll='exa -lbGFa --git --icons --color always' # long list
alias llm='exa -lbGF --git --sort=modified' # long list, modified date sort
alias la='exa -bGFa --git --color always --icons' # shorter all list
alias lla='exa -lbhHigUmuSa --time-style=long-iso --git --color-scale --icons' # longer all list
alias lx='exa -lbhHigUmuSa@ --time-style=long-iso --git --color-scale' # all
### BAT
export BAT_THEME="Dracula"
export BAT_STYLE="full"
alias cat='bat'
### Update homeServer
alias homeServer="ssh ez@192.168.0.178"
alias updateserver='ssh -t ez@192.168.0.178 "sudo -- sh -c /home/ez/.local/bin/updater"'
### COPYFILE
cpfile() {
xclip -sel c "$@" && echo -e "\n\"$@\" was copied to the clipboard\n"
}
2023-04-08 11:17:10 -05:00
### Fuzzy History Finder utility
2023-04-07 18:42:12 -05:00
fhf() {
cat $HOME/.zhistory |
fzf --scheme=history \
--cycle \
--border=double \
--border-label="| Command History |" \
2023-04-08 05:59:39 -05:00
--margin=2,20,2,20 \
--padding=0,10,0,22 \
--height=60% \
--color='fg+:15,fg:42,hl+:134,hl:123,query:134,gutter:0,label:134,border:134,prompt:15,pointer:15,marker:15,header:123' \
--prompt=' ' \
--pointer='󰧚 ' \
--header="Select command to copy" \
2023-04-07 18:42:12 -05:00
--info=hidden \
2023-04-08 05:59:39 -05:00
--no-scrollbar \
--reverse \
2023-04-07 18:42:12 -05:00
--tac |
tr -d '\n' |
xclip -sel c
}
2023-04-08 11:17:10 -05:00
### Fuzzy Man Finder utility
2023-04-07 18:42:12 -05:00
fmf() {
man -k . |
sort - |
fzf -q "$1" +m \
--cycle \
--reverse \
2023-04-08 05:59:39 -05:00
--color='fg+:15,fg:42,hl+:134,hl:123,query:134,gutter:0,label:134,border:134,prompt:15,pointer:15,marker:15,header:123' \
--prompt=' ' \
--pointer='󰧚 ' \
--tiebreak=begin,chunk,length \
2023-04-08 14:49:43 -05:00
--preview="echo -e '\n\t\t\t\t \033[4mCHEAT SHEET:\033[0m\n'; cheat {1}; echo -e '\n\t\t\t\t \033[4mTLDR:\033[0m\n'; tldr {1}; echo -e '\n\t\t\t\t \033[4mMANUAL PAGE:\033[0m\n'; man -Hw3m {1} 2> /dev/null" \
2023-04-08 14:28:04 -05:00
--preview-window=62%:wrap:border-rounded \
2023-04-07 18:42:12 -05:00
--preview-label="| Manual Entry |"
}
2023-06-02 13:59:57 -05:00
### Fuzzy Cheatsheat utility (WIP may replace fmf)
\?() {
curl -s cheat.sh/:list > /tmp/cheatlist
fzf --preview='curl -s cheat.sh/{}; echo; man -Hw3m {} 2> /dev/null' \
--bind=ctrl-h:preview:'curl -s cheat.sh/:help' \
--preview-window=62%:wrap:border-rounded \
--color='fg+:15,fg:42,hl+:134,hl:123,query:134,gutter:0,label:134,border:134,prompt:15,pointer:15,marker:15,header:123' \
--tiebreak=begin,chunk,length \
--reverse \
--cycle \
--prompt=' ' \
--pointer='󰧚 ' \
< /tmp/cheatlist
}
2023-04-07 18:42:12 -05:00
2023-04-08 11:17:10 -05:00
### Emoji selector
2023-04-08 05:59:39 -05:00
emojis() {
emojis=$(curl -sSL 'https://git.io/JXXO7')
echo $emojis |
fzf --cycle \
--border=double \
--border-label="| Emoji Selector |" \
--margin=2,20,2,20 \
--padding=0,10,0,22 \
--height=60% \
--color='fg+:15,fg:42,hl+:134,hl:123,query:134,gutter:0,label:134,border:134,prompt:15,pointer:15,marker:15,header:123' \
--prompt=' ' \
--pointer='󰧚 ' \
--header="Select emoji to copy" \
--info=hidden \
--no-scrollbar \
--tiebreak=begin,chunk,length \
--reverse |
awk '{print $1}' |
tr -d '\n' |
xclip -sel c
}
2023-04-07 18:42:12 -05:00
### Test terminal color codes and visual appearance
alias colors="curl -s https://gist.githubusercontent.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263/raw/ | bash"
### Launch PowerShell w fancy ps1
2023-04-15 21:53:30 -05:00
alias pwsh="pwsh -NoExit -c /home/ez/OMP/pwshPromt.ps1"
2023-04-07 18:42:12 -05:00
### Pacnew file maintenance with pacdiff using meld
alias pacnew="sudo DIFFPROG=meld pacdiff"
2023-04-08 11:17:10 -05:00
### GITHUB personal access token
2023-04-07 18:42:12 -05:00
alias gitpw="cpfile ~/Git/PersonalAccessToken/PAT"