From db0a6c9cc9fbed9dc1a6c4bbdb1320976f596270 Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 24 Jun 2022 14:52:42 +0900 Subject: [PATCH] fix Vim-like key mappings usage in doc --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8a4aa44..d30a03b 100644 --- a/README.md +++ b/README.md @@ -371,10 +371,21 @@ loop { Input { key: Key::Char('l'), .. } => textarea.move_cursor(CursorMove::Forward), Input { key: Key::Char('w'), .. } => textarea.move_cursor(CursorMove::WordForward), Input { key: Key::Char('b'), .. } => textarea.move_cursor(CursorMove::WordBack), - Input { key: Key::Char('D'), .. } => textarea.delete_line_by_end(), - Input { key: Key::Char('u'), .. } => textarea.undo(), - Input { key: Key::Char('R'), ctrl: true, .. } => textarea.redo(), + Input { key: Key::Char('^'), .. } => textarea.move_cursor(CursorMove::Home), + Input { key: Key::Char('$'), .. } => textarea.move_cursor(CursorMove::End), + Input { key: Key::Char('D'), .. } => { textarea.delete_line_by_end(); } + Input { key: Key::Char('p'), .. } => { textarea.paste(); } + Input { key: Key::Char('u'), .. } => { textarea.undo(); }, + Input { key: Key::Char('R'), .. } => { textarea.redo(); }, Input { key: Key::Char('i'), .. } => mode = Mode::Insert, + Input { key: Key::Char('A'), .. } => { + textarea.move_cursor(CursorMove::End); + mode = Mode::Insert; + } + Input { key: Key::Char('I'), .. } => { + textarea.move_cursor(CursorMove::Home); + mode = Mode::Insert; + } _ => {}, }, Mode::Insert => match Input::from(read()?) {