]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/colemak/colemak.plugin.zsh
...
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / colemak / colemak.plugin.zsh
1 # ctrl-j newline
2 bindkey '^n' accept-line
3 bindkey -a '^n' accept-line
4
5 # another rotation to match qwerty
6 bindkey -a 'n' down-line-or-history
7 bindkey -a 'e' up-line-or-history
8 bindkey -a 'i' vi-forward-char
9
10 # make qwerty
11 bindkey -a 'k' vi-repeat-search
12 bindkey -a 'K' vi-rev-repeat-search
13 bindkey -a 'u' vi-insert
14 bindkey -a 'U' vi-insert-bol
15 bindkey -a 'l' vi-undo-change
16 bindkey -a 'N' vi-join
17
18 # spare
19 bindkey -a 'j' vi-forward-word-end
20 bindkey -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
24 0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
25 0="${${(M)0:#/*}:-$PWD/$0}"
26
27 # New less versions will read this file directly
28 export LESSKEYIN="${0:h:A}/colemak-less"
29
30 # Only run lesskey if less version is older than v582
31 less_ver=$(less --version | awk '{print $2;exit}')
32 autoload -Uz is-at-least
33 if ! 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
37 fi
38 unset less_ver