shownotes-w3m-rice/zsh_vim_mode.txt

48 lines
1.2 KiB
Plaintext
Raw Normal View History

2013-05-24 22:14:09 +00:00
# this is notes for video: http://www.youtube.com/watch?v=EIp6TSC8SOQ
2013-03-28 19:16:55 +00:00
##### for ~/.zshrc
# enable vim mode on commmand line
bindkey -v
2013-04-25 05:24:18 +00:00
# no delay entering normal mode
# https://coderwall.com/p/h63etq
# https://github.com/pda/dotzsh/blob/master/keyboard.zsh#L10
# 10ms for key sequences
KEYTIMEOUT=1
2013-03-28 19:16:55 +00:00
# show vim status
# http://zshwiki.org/home/examples/zlewidgets
function zle-line-init zle-keymap-select {
RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
RPS2=$RPS1
zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select
# add missing vim hotkeys
# http://zshwiki.org/home/zle/vi-mode
bindkey -a u undo
2016-02-07 10:39:46 +00:00
bindkey -a '^T' redo
bindkey '^?' backward-delete-char #backspace
2013-03-28 19:16:55 +00:00
# history search in vim mode
# http://zshwiki.org./home/zle/bindkeys#why_isn_t_control-r_working_anymore
2016-02-07 10:39:46 +00:00
# ctrl+r to search history
bindkey -M viins '^r' history-incremental-search-backward
bindkey -M vicmd '^r' history-incremental-search-backward
2013-03-28 19:16:55 +00:00
##### for ~/tmux.conf
# Lowers the delay time between the prefix key and other keys - fixes pausing in vim
set -sg escape-time 1
# reload .tmux.conf
bind-key r source-file ~/.tmux.conf \; display-message "Configuration reloaded"