From 4d6d6c223f24eb2a5bd3bc61e990116486d2b7ac Mon Sep 17 00:00:00 2001 From: Cheney Date: Fri, 2 Oct 2015 10:58:43 +0800 Subject: [PATCH] fixes bugs --- README.md | 13 +------------ vim.go | 4 ++-- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0d5dd8d..72154aa 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,11 @@ You can read the source code in [example/main.go](https://github.com/chzyer/read # Todo -* Vim mode (WIP) * More funny examples * Support dumb/eterm-color terminal in emacs # Features -* Support emacs/vi mode, almost all basic features GNU-Readline support +* Support emacs/vi mode, almost all basic features that GNU-Readline is supported * zsh-style backward/forward history search * zsh-style completion * Readline auto refresh when others write to Stdout while editing(it needs specify the Stdout/Stderr provided by *readline.Instance to others). @@ -205,16 +204,6 @@ Notice: `Meta`+`B` is equals with `Alt`+`B` in windows. | `Ctrl`+`C` / `Ctrl`+`G` | Exit Complete Select Mode | | Other | Exit Complete Select Mode | -* Vim Mode (set Config.VimMode to true) - -| Mode | Shortcut | Comment | -|--------+----------+---------------------------------------------| -| Normal | `j` | Next line (in history) | -| | `k` | Prev line (in history) | -| | `h` | Move Backward | -| | `l` | Move Forward | - - # Tested with | Environment | $TERM | diff --git a/vim.go b/vim.go index 61f28e0..f587b6c 100644 --- a/vim.go +++ b/vim.go @@ -53,9 +53,9 @@ func (o *opVim) handleVimNormalMovement(r rune, readNext func() rune) (t rune, h rb.MoveToLineStart() case '$': rb.MoveToLineEnd() - case 'b': + case 'b', 'B': rb.MoveToPrevWord() - case 'w': + case 'w', 'W', 'e', 'E': rb.MoveToNextWord() case 'f', 'F', 't', 'T': next := readNext()