@register(u'capitalize-word')
def capitalize_word(event):
 buff = event.current_buffer
 for i in range(event.arg):
  pos = buff.document.find_next_word_ending()
  words = buff.document.text_after_cursor[:pos]
  buff.insert_text(words.title(), overwrite=True)

@ register ( u'capitalize-word' ) def capitalize_word ( event ) : buff = event . current_buffer for i in range ( event . arg ) : pos = buff . document . find_next_word_ending ( ) words = buff . document . text_after_cursor [ : pos ] buff . insert_text ( words . title ( ) , overwrite = True )
capitalize the current word .