zsh: add some suffix aliases
Aliases that run when files of a matching type are opened. See https://youtu.be/8CZIv3MJvic?si=QVqtaCDNaygs2qaE&t=670.
This commit is contained in:
parent
c712a1b254
commit
b30909b32a
|
@ -13,6 +13,19 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
|
# suffix
|
||||||
|
alias -s gz="tar -tf"
|
||||||
|
alias -s {html,HTML}="background firefox"
|
||||||
|
alias -s {jpg,JPG,png,PNG}="background okular"
|
||||||
|
alias -s {pdf,PDF}="background okular"
|
||||||
|
alias -s {zip,ZIP}="unzip -l"
|
||||||
|
|
||||||
|
background() {
|
||||||
|
for ((i=2;i<=$#;i++)); do
|
||||||
|
''${@[1]} ''${@[$i]} &> /dev/null &
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
git() {
|
git() {
|
||||||
if [[ "''${1}" == "root" ]]; then
|
if [[ "''${1}" == "root" ]]; then
|
||||||
shift
|
shift
|
||||||
|
|
Loading…
Reference in a new issue