Skip to content

Instantly share code, notes, and snippets.

@mcgwiz
Last active April 23, 2017 20:19
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcgwiz/9082394 to your computer and use it in GitHub Desktop.
Save mcgwiz/9082394 to your computer and use it in GitHub Desktop.
Super simple JavaScript git diff hunk header config
*.js diff="javascript"
# In git config: .git/config, ~/.gitconfig, /etc/gitconfig
[diff "javascript"]
xfuncname = "^\\s*(.*?\\bfunction\\b.*?\\(.*?\\))"
@eilgin
Copy link

eilgin commented Apr 23, 2017

Cool tip !
But this doesn't work for functions like this (ES2015 syntax):

class Foo {
  constructor () {
    this.bar = "baz"
  }

  getBar () {
    return this.bar
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment