ChestyPuller wrote:Is it possible to convert a selection to proper case? i.e. First letters of each word to uppercase? Thanks!
class TitleCaseCommand(sublimeplugin.TextCommand):
def run(self, view, args):
self.transformSelectionText(string.capwords, view)
def isEnabled(self, view, args):
return view.hasNonEmptySelectionRegion()
def transformSelectionText(self, f, v):
for s in v.sel():
if not s.empty():
txt = f(v.substr(s))
v.replace(s, txt)ChestyPuller wrote:Nevermind...I just answered my own question. Alt + k, then release and press t is exactly it. I the action I wrote in the last post was the only action I didn't actually try yet. Thanks a lot for your quick help on this and for that great plugin!!
class CapitalizeCaseCommand (sublimeplugin.TextCommand):
def run (self, view, args):
transformSelectionText (string.capwords, view)
Users browsing this forum: Jibz, Orlmente, whololo and 7 guests