Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tell application "Xcode"
set CurrentDocument to document 1 whose name ends with (get name of front window)
set FilePath to path of CurrentDocument
set {start, _} to selected paragraph range of CurrentDocument
tell application "Terminal"
do script "FILE=\"" & FilePath & "\"; cd \"$(dirname \"$FILE\")\"; cd \"$(git rev-parse --show-toplevel)\"; tig blame +" & start & " \"$FILE\""
activate
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment