Skip to content

Instantly share code, notes, and snippets.

@odnoletkov
Created February 8, 2018 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odnoletkov/d2a8cc3be089fd32742949ffd350832f to your computer and use it in GitHub Desktop.
Save odnoletkov/d2a8cc3be089fd32742949ffd350832f to your computer and use it in GitHub Desktop.
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