-1

I would like to use Image Magick to trim some images via

convert -trim image.png image.png

Is there a way to register an alias in Fish Shell, that would shorten the above statement to something like this?

trim image.png

If so, how do I implement this?

doque
  • 2,723
  • 6
  • 27
  • 44

1 Answers1

1

fish does not have aliases; you need to define a function instead.

function trim
    convert -trim $argv[1] $argv[1]
end

Running fish -c help (or simply help if you are already in a fish session) will open the fish documentation in a web browser, where you can find the documentation for the function command used to define shell functions.

chepner
  • 497,756
  • 71
  • 530
  • 681