Pretty simple but useful plugin. Converts the word currently being touched by the cursor to camel case, pascal case, or snake case.
Source code is hosted at the following locations (with Scott's contributions):
jdc0589 wrote:Pretty simple but useful plugin. Converts the word currently being touched by cursor to camel case (ctrl+alt+c), pascal case (ctrl+alt+p), or snake case (ctrl+alt+s).
Download: http://net-machine.com/indefero/p/public/downloads/ and then "CaseConversion.zip".
This is my first plugin (and first python endeavor) so any feedback, good or bad, is welcome.
scottbessler wrote:I modified this to follow pep8 and to work on all selections when doing multi-select and posted it up here:
https://bitbucket.org/scottbessler/subl ... conversion
[
{ "keys": ["ctrl+f5"], "command": "refreshFolderList"},
{ "keys": ["ctrl+alt+s"], "command": "convert_to_snake"},
{ "keys": ["ctrl+alt+c"], "command": "convert_to_camel"},
{ "keys": ["ctrl+alt+p"], "command": "convert_to_pascal"}
][
{ "keys": ["ctrl+alt+c", "ctrl+alt+s"], "command": "convert_to_snake"},
{ "keys": ["ctrl+alt+c", "ctrl+alt+c"], "command": "convert_to_camel"},
{ "keys": ["ctrl+alt+c", "ctrl+alt+p"], "command": "convert_to_pascal"}
]bizoo wrote:scottbessler wrote:I modified this to follow pep8 and to work on all selections when doing multi-select and posted it up here:
https://bitbucket.org/scottbessler/subl ... conversion
Great addition and nice to have it on Package Control, thanks for your update.
May I suggest something ?
The first entry in the .sublime-keymap is probably a mistake:
- Code: Select all
[
{ "keys": ["ctrl+f5"], "command": "refreshFolderList"},
{ "keys": ["ctrl+alt+s"], "command": "convert_to_snake"},
{ "keys": ["ctrl+alt+c"], "command": "convert_to_camel"},
{ "keys": ["ctrl+alt+p"], "command": "convert_to_pascal"}
]
And personally I prefer shortcut for grouped functionality to be also grouped, something like that:
- Code: Select all
[
{ "keys": ["ctrl+alt+c", "ctrl+alt+s"], "command": "convert_to_snake"},
{ "keys": ["ctrl+alt+c", "ctrl+alt+c"], "command": "convert_to_camel"},
{ "keys": ["ctrl+alt+c", "ctrl+alt+p"], "command": "convert_to_pascal"}
]
When you have lot of plugins, it's become really hard to deal with shortcuts clashes, especially when one plugin define lot of shortcuts.
Return to Plugin Announcements
Users browsing this forum: No registered users and 5 guests