Last active
December 23, 2020 07:47
-
-
Save bjorne/764a565fed6dc5c8f6af038ba3a0c065 to your computer and use it in GitHub Desktop.
Command-click to open in emacs from iTerm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
export PATH="/Users/bjorne/.evm/bin:$PATH" | |
export EMACS_HOME="$(dirname $(readlink $(which evm-emacs)))" | |
export EDITOR="$EMACS_HOME/bin/emacsclient" | |
pwd=$1 | |
path=$2 | |
lineno=$3 | |
if [[ "$path" =~ ^[^/] ]]; then | |
path="${pwd}${path}" | |
fi | |
if [ -n "$lineno" ]; then | |
lineno="+$lineno" | |
fi | |
$EDITOR --quiet --alternate-editor=nano --no-wait $lineno $path > /tmp/clicklog 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! This was a great help for me :)