zsh: minor renames/reorder
This commit is contained in:
parent
a8c557f4d2
commit
56f97684a8
1 changed files with 12 additions and 9 deletions
|
@ -1,7 +1,3 @@
|
||||||
# Use vi mode for line editing.
|
|
||||||
bindkey -v
|
|
||||||
export KEYTIMEOUT=1
|
|
||||||
|
|
||||||
set_cursor_shape() {
|
set_cursor_shape() {
|
||||||
local block='\e[1 q' # blinking block
|
local block='\e[1 q' # blinking block
|
||||||
local underline='\e[3 q' # blinking underline, 4 for steady
|
local underline='\e[3 q' # blinking underline, 4 for steady
|
||||||
|
@ -19,18 +15,25 @@ set_cursor_shape() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Start new prompts with bar shaped cursor.
|
||||||
|
init_line_editor() {
|
||||||
|
set_cursor_shape bar
|
||||||
|
}
|
||||||
|
|
||||||
# Switch cursor shape depending on editing mode.
|
# Switch cursor shape depending on editing mode.
|
||||||
zle-keymap-select() {
|
keymap_did_change() {
|
||||||
case $KEYMAP in
|
case $KEYMAP in
|
||||||
vicmd) set_cursor_shape block ;;
|
vicmd) set_cursor_shape block ;;
|
||||||
viins|main) set_cursor_shape bar ;;
|
viins|main) set_cursor_shape bar ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
zle -N zle-keymap-select
|
|
||||||
|
|
||||||
# Start new prompts with bar shaped cursor.
|
zle -N zle-line-init init_line_editor
|
||||||
zle-line-init() { set_cursor_shape bar }
|
zle -N zle-keymap-select keymap_did_change
|
||||||
zle -N zle-line-init
|
|
||||||
|
# Use vi mode for line editing.
|
||||||
|
bindkey -v
|
||||||
|
export KEYTIMEOUT=1
|
||||||
|
|
||||||
# Search through history in insert mode.
|
# Search through history in insert mode.
|
||||||
bindkey -M viins '^j' history-beginning-search-forward
|
bindkey -M viins '^j' history-beginning-search-forward
|
||||||
|
|
Loading…
Add table
Reference in a new issue