Aliases with functions in .zshrc not working

I’m too lazy to learn. :stuck_out_tongue:

Here’s a patch you can test:

--- manjaro-zsh-config  2022-12-04 11:20:22.638686150 +0100
+++ new-manjaro-zsh-config      2022-12-04 11:21:42.901298755 +0100
@@ -55,9 +55,9 @@
 bindkey '^[[Z' undo                                             # Shift+tab undo last action

 ## Alias section
-alias cp='f(){fo=${1:--i}; shift; cp $fo $*};f'                                           # Confirm before overwriting something
-alias df='f(){if test $# -eq 0;then opts=(-h);else opts=("$@");fi; df "$opts[@]"};f'      # Human-readable sizes
-alias free='f(){if test $# -eq 0;then opts=(-m);else opts=("$@");fi; free "$opts[@]"};f'  # Show sizes in MB
+alias cp='(){fo=${1:--i}; shift; cp $fo $*}'                                           # Confirm before overwriting something
+alias df='(){if test $# -eq 0;then opts=(-h);else opts=("$@");fi; df "$opts[@]"}'      # Human-readable sizes
+alias free='(){if test $# -eq 0;then opts=(-m);else opts=("$@");fi; free "$opts[@]"}'  # Show sizes in MB
 alias gitu='git add . && git commit && git push'

 # Theming section

You have my explicit permission to stamp your signature below it and earn all the money yourself.

1 Like

If that would be true i would be richer as i already am :rofl:
Unfortunately, or luckily depending on your pov, no one earns any cash when contributing to open source software parts :wink:

But thanks, ill try to make time for this soon™ :smiling_face:

Pinging @Chrysostomus to read the discussion and maybe have him re-fix mine :smiling_face:

1 Like