Skip to content

Instantly share code, notes, and snippets.

@a1ip
Last active September 20, 2017 16:45
Show Gist options
  • Save a1ip/9758500 to your computer and use it in GitHub Desktop.
Save a1ip/9758500 to your computer and use it in GitHub Desktop.
Google translate for fish shell
function trs --description 'Google translate'
if test (count $argv) -gt 1
translate \{$argv[1]\} $argv[2..(count $argv)] | gawk '{gsub(/^({+\s+)+/, "")};1' | gawk '{gsub(/\s+}+$/, "")};1'
else
translate $argv
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment