Skip to content

Instantly share code, notes, and snippets.

@mrpoptart
Last active September 11, 2017 17:53
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 mrpoptart/5ffa453820d6065a649c3882dffe7756 to your computer and use it in GitHub Desktop.
Save mrpoptart/5ffa453820d6065a649c3882dffe7756 to your computer and use it in GitHub Desktop.
#Gets the current branch and project name and uses that to compile a github URL that matches what you have open in Jetbrains
#jetbrains settings -> tools -> external tools
#program: /path/to/this/.file
#parameters: $ProjectFileDir$ $FilePathRelativeToProjectRoot$ $SelectionStartLine$ $SelectionEndLine$
#working directory: $ProjectFileDir$
open $(cd $1 && echo $(git config --get remote.origin.url | sed -e 's/git@/https:\/\//' | sed -e 's/\.net:/.net\//' | sed -e 's/.git$/\//')"blob/"$(git rev-parse --abbrev-ref HEAD)"/"$2#L$3-L$4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment