@register(u'unix-word-rubout')
def unix_word_rubout(event, WORD=True):
 buff = event.current_buffer
 pos = buff.document.find_start_of_previous_word(count=event.arg, WORD=WORD)
 if (pos is None):
  pos = (- buff.cursor_position)
 if pos:
  deleted = buff.delete_before_cursor(count=(- pos))
  if event.is_repeat:
   deleted += event.cli.clipboard.get_data().text
  event.cli.clipboard.set_text(deleted)
 else:
  event.cli.output.bell()

@ register ( u'unix-word-rubout' ) def unix_word_rubout ( event , WORD = True ) : buff = event . current_buffer pos = buff . document . find_start_of_previous_word ( count = event . arg , WORD = WORD ) if ( pos is None ) : pos = ( - buff . cursor_position ) if pos : deleted = buff . delete_before_cursor ( count = ( - pos ) ) if event . is_repeat : deleted += event . cli . clipboard . get_data ( ) . text event . cli . clipboard . set_text ( deleted ) else : event . cli . output . bell ( )
kill the word behind point .