@@ -179,16 +179,11 @@ impl Prompt {
179179 self.exit_selection();
180180 }
181181
182− pub fn move_char_left(&mut self) {
183− let pos = self.eval_movement(Movement::BackwardChar(1));
182+ pub fn move_cursor(&mut self, movement: Movement) {
183+ let pos = self.eval_movement(movement);
184184 self.cursor = pos
185185 }
186186
187− pub fn move_char_right(&mut self) {
188− let pos = self.eval_movement(Movement::ForwardChar(1));
189− self.cursor = pos;
190− }
191−
192187 pub fn move_start(&mut self) {
193188 self.cursor = 0;
194189 }
@@ -215,6 +210,14 @@ impl Prompt {
215210 self.completion = (self.completion_fn)(&self.line);
216211 }
217212
213+ pub fn kill_to_end_of_line(&mut self) {
214+ let pos = self.eval_movement(Movement::EndOfLine);
215+ self.line.replace_range(self.cursor..pos, "");
216+
217+ self.exit_selection();
218+ self.completion = (self.completion_fn)(&self.line);
219+ }
220+
218221 pub fn clear(&mut self) {
219222 self.line.clear();
220223 self.cursor = 0;
@@ -386,31 +389,71 @@ impl Component for Prompt {
386389 (self.callback_fn)(cx.editor, &self.line, PromptEvent::Update);
387390 }
388391 KeyEvent {
392+ code: KeyCode::Char('c'),
393+ modifiers: KeyModifiers::CONTROL,
394+ }
395+ | KeyEvent {
389396 code: KeyCode::Esc, ..
390397 } => {
391398 (self.callback_fn)(cx.editor, &self.line, PromptEvent::Abort);
392399 return close_fn;
393400 }
394401 KeyEvent {
402+ code: KeyCode::Char('f'),
403+ modifiers: KeyModifiers::CONTROL,
404+ }
405+ | KeyEvent {
395406 code: KeyCode::Right,
396407 ..
397− } => self.move_char_right(),
408+ } => self.move_cursor(Movement::ForwardChar(1)),
398409 KeyEvent {
410+ code: KeyCode::Char('b'),
411+ modifiers: KeyModifiers::CONTROL,
412+ }
413+ | KeyEvent {
399414 code: KeyCode::Left,
400415 ..
401− } => self.move_char_left(),
416+ } => self.move_cursor(Movement::BackwardChar(1)),
402417 KeyEvent {
418+ code: KeyCode::End,
419+ modifiers: KeyModifiers::NONE,
420+ }
421+ | KeyEvent {
403422 code: KeyCode::Char('e'),
404423 modifiers: KeyModifiers::CONTROL,
405424 } => self.move_end(),
406425 KeyEvent {
426+ code: KeyCode::Home,
427+ modifiers: KeyModifiers::NONE,
428+ }
429+ | KeyEvent {
407430 code: KeyCode::Char('a'),
408431 modifiers: KeyModifiers::CONTROL,
409432 } => self.move_start(),
433+ KeyEvent {
434+ code: KeyCode::Left,
435+ modifiers: KeyModifiers::ALT,
436+ }
437+ | KeyEvent {
438+ code: KeyCode::Char('b'),
439+ modifiers: KeyModifiers::ALT,
440+ } => self.move_cursor(Movement::BackwardWord(1)),
441+ KeyEvent {
442+ code: KeyCode::Right,
443+ modifiers: KeyModifiers::ALT,
444+ }
445+ | KeyEvent {
446+ code: KeyCode::Char('f'),
447+ modifiers: KeyModifiers::ALT,
448+ } => self.move_cursor(Movement::ForwardWord(1)),
410449 KeyEvent {
411450 code: KeyCode::Char('w'),
412451 modifiers: KeyModifiers::CONTROL,
413452 } => self.delete_word_backwards(),
453+ KeyEvent {
454+ code: KeyCode::Char('k'),
455+ modifiers: KeyModifiers::CONTROL,
456+ } => self.kill_to_end_of_line(),
414457 KeyEvent {
415458 code: KeyCode::Backspace,
416459 modifiers: KeyModifiers::NONE,