Skip to content

Instantly share code, notes, and snippets.

@mediafinger
Last active December 20, 2015 08:48
Show Gist options
  • Save mediafinger/6102751 to your computer and use it in GitHub Desktop.
Save mediafinger/6102751 to your computer and use it in GitHub Desktop.
Replace multiple selection while preserving the case

Hey Sublime users,

add this to you key bindings:

{ "keys": ["super+m"], "command": "show_panel", "args": {"panel": "replace", "in_selection": true, "preserve_case": true, "regex": false, "highlight": true} }
  • Select all he occurrences of a word you want to replace with CMD+D
  • CMD+M (or whichever shortcut you chose for this new command)
  • TAB to lower field, insert your replacement
  • CTRL+ALT+ENTER to replace all selected words while preserving the case of the letters

This works great with a mixture of Capitalized and lowercase strings - with camelCase it only works when the first part of the replacement is as long as in the original string...

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