Skip to content

Instantly share code, notes, and snippets.

@david-pm
Created December 21, 2018 23:39
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 david-pm/9c3416d4cc5802ec9a9f8e101d306519 to your computer and use it in GitHub Desktop.
Save david-pm/9c3416d4cc5802ec9a9f8e101d306519 to your computer and use it in GitHub Desktop.
a sed script to convert camelcase and or pascalcase to snakecase
# sed -i -f convert_to_snakecase __yourfile__
#
# to run this within in vim:
# %s/[A-Z]/_\L&/g | %s/\<_//g
s/[A-Z]/_\L&/g; s/\b_//g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment