colemak.plugin.zsh
1095 bytes
1# ctrl-j newline
2bindkey '^n' accept-line
3bindkey -a '^n' accept-line
4
5# another rotation to match qwerty
6bindkey -a 'n' down-line-or-history
7bindkey -a 'e' up-line-or-history
8bindkey -a 'i' vi-forward-char
9
10# make qwerty
11bindkey -a 'k' vi-repeat-search
12bindkey -a 'K' vi-rev-repeat-search
13bindkey -a 'u' vi-insert
14bindkey -a 'U' vi-insert-bol
15bindkey -a 'l' vi-undo-change
16bindkey -a 'N' vi-join
17
18# spare
19bindkey -a 'j' vi-forward-word-end
20bindkey -a 'J' vi-forward-blank-word-end
21
22# Handle $0 according to the standard:
23# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
240="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
250="${${(M)0:#/*}:-$PWD/$0}"
26
27# New less versions will read this file directly
28export LESSKEYIN="${0:h:A}/colemak-less"
29
30# Only run lesskey if less version is older than v582
31less_ver=$(less --version | awk '{print $2;exit}')
32autoload -Uz is-at-least
33if ! is-at-least 582 $less_ver; then
34 # Old less versions will read this transformed file
35 export LESSKEY="${0:h:A}/.less"
36 lesskey -o "$LESSKEY" "$LESSKEYIN" 2>/dev/null
37fi
38unset less_ver