Remove incorrect vi bindings

This commit is contained in:
Kenneth Benzie 2017-12-01 16:57:24 +00:00
parent b6fffc35fc
commit a8fe7e42af
2 changed files with 12 additions and 10 deletions

View File

@ -86,13 +86,11 @@ starting point but was replaced as it uses some strange defaults.
#### `vicmd` Mode #### `vicmd` Mode
Whole line operations for yank, change, and delete are enabled mode with `Y`, Undo and repo and enabled using `u` and `U`. Showing help for the command under
`C`, and `D` respectively. Undo and repo and enabled using `u` and `U`. Showing the cursor with `<Esc>h` is replaced with `K`. The [Vim][vim] "Ex" mode binding
help for the command under the cursor with `<Esc>h` is replaced with `K`. The `:` is disabled mode since is barely of use and easy to enter accidentally.
[Vim][vim] "Ex" mode binding `:` is disabled mode since is barely of use and Bindings for `k` and `j` integrate with [zsh-history-substring-search][search]
easy to enter accidentally. Bindings for `k` and `j` integrate with performing up and down searches respectively.
[zsh-history-substring-search][search] performing up and down searches
respectively.
#### Edit Command Line #### Edit Command Line
@ -129,3 +127,4 @@ Various aliases are defined at the end of [zshrc](zshrc) for convenience.
[syntax]: https://github.com/zsh-users/zsh-syntax-highlighting [syntax]: https://github.com/zsh-users/zsh-syntax-highlighting
[search]: https://github.com/zsh-users/zsh-history-substring-search [search]: https://github.com/zsh-users/zsh-history-substring-search
[vim-mode]: https://github.com/sharat87/zsh-vim-mode [vim-mode]: https://github.com/sharat87/zsh-vim-mode
[vim]: http://www.vim.org/

9
zshrc
View File

@ -38,15 +38,18 @@ prompt fresh
# Enable vi mode line editor keymap # Enable vi mode line editor keymap
bindkey -v bindkey -v
# Enable yank, change, and delete whole line with 'Y', 'C', and 'D' # Enable yank, change, and delete whole line with 'Y', 'cc', and 'dd'
bindkey -M vicmd 'Y' vi-yank-whole-line bindkey -M vicmd 'Y' vi-yank-whole-line
bindkey -M vicmd 'C' vi-change-whole-line
bindkey -M vicmd 'D' kill-whole-line
# Enable undo with 'u' and redo with 'U' # Enable undo with 'u' and redo with 'U'
bindkey -M vicmd 'u' undo bindkey -M vicmd 'u' undo
bindkey -M vicmd 'U' redo bindkey -M vicmd 'U' redo
# Enable toggle comment at start of line al la vim-commentary
bindkey -M vicmd 'gcc' vi-pound-insert
# TODO: vi-pipe???
# Enable substring history search with 'j' and 'k' # Enable substring history search with 'j' and 'k'
bindkey -M vicmd 'k' history-substring-search-up bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down bindkey -M vicmd 'j' history-substring-search-down