Skip to content

Instantly share code, notes, and snippets.

@toonetown
Last active February 7, 2025 19:32
Show Gist options
  • Save toonetown/bb6bc9e8476b1a591dd25faa7e180acb to your computer and use it in GitHub Desktop.
Save toonetown/bb6bc9e8476b1a591dd25faa7e180acb to your computer and use it in GitHub Desktop.
A script which wraps around `mate -w` or `rmate -w` for use in EDITOR variables
#!/bin/bash
PFX="$(which brew &>/dev/null && brew --prefix || echo "/usr/local")"
if [ -n "${SSH_CONNECTION}" ]; then
exec "$(brew --prefix)/bin/rmate" -w "$@"
else
exec "$(brew --prefix)/bin/mate" -w "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment