dot

packages and services management
Log | Files | Refs | README

commit d4c7b8674810441847b4032f90e37e10c881cb9b
parent a5ded7682c74ddd1df16ff66c717ed540203534a
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri, 21 Apr 2017 21:48:44 +0200

general purpose fig figlet alternative

Diffstat:
Mbin/build | 12++++--------
Abin/fig | 30++++++++++++++++++++++++++++++
Dbin/fig-1 | 490-------------------------------------------------------------------------------
Dbin/fig-2 | 517-------------------------------------------------------------------------------
Mbuild/st | 6++++++
Mbuild/vis | 10+++++++++-
Afig/1 | 491+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Afig/2 | 495+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dvis/config.h | 404-------------------------------------------------------------------------------
9 files changed, 1035 insertions(+), 1420 deletions(-)

diff --git a/bin/build b/bin/build @@ -6,10 +6,10 @@ export CONFIG="${CONFIG:-$HOME/.config}" export PROGRAMS="$HOME/programs" export PATH="$LOCAL/sbin:$LOCAL/bin:$PATH" export MANPATH="$LOCAL/share/man:$LOCAL/man:$MANPATH" -#export CPATH="$LOCAL/include:$CPATH" -#export LIBPATH="$LOCAL/lib:$LIBPATH" -#export LD_RUN_PATH="$LOCAL/lib:$LD_RUN_PATH" -#export LD_LIBRARY_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" +export CPATH="$LOCAL/include:$CPATH" +export LIBPATH="$LOCAL/lib:$LIBPATH" +export LD_RUN_PATH="$LOCAL/lib:$LD_RUN_PATH" +export LD_LIBRARY_PATH="$LOCAL/lib:$LD_LIBRARY_PATH" [ "${0##*/}" = build ] && { @@ -52,10 +52,6 @@ compile() { PREFIX="$PROGRAMS/$1" script="$CONFIG/build/$1" -# export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 -# export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 -# export CFLAGS="-I$CPATH -L$LIBPATH -static" - [ -f "$script" ] || [ -h "$script" ] || exit 1 . "$script" diff --git a/bin/fig b/bin/fig @@ -0,0 +1,30 @@ +# figlet without all the bells and fanciness. + +IFS=' +' + +set -- $(printf '%s ' "$@" | fold -w 1) + +for character in "$@" +do + set -- $( + while IFS='' read -r line + do + [ "$print" = 1 ] && [ "$line" = '' ] && break + [ "$print" = 1 ] && printf '%s\n' "$line" + [ "$line" = "$character" ] && print=1 + done < "$CONFIG/fig/${FONT:-1}" | sed 's/;$//' + ) + + l1="$l1$1 " + l2="$l2$2 " + l3="$l3$3 " + l4="$l4$4 " + l5="$l5$5 " + l6="$l6$6 " + l7="$l7$7 " + l8="$l8$8 " +done + +printf '%s\n' "$l1" "$l2" "$l3" "$l4" "$l5" "$l6" "$l7" "$l8" | +sed -r 's/ *$//; /^$/ d' diff --git a/bin/fig-1 b/bin/fig-1 @@ -1,490 +0,0 @@ -# figlet without all the bells and fanciness. - -if [ $# = 0 ] -then - tee -else - printf '%s\n' "$*" -fi | fold -w 1 | { - while IFS= read -r c - do - case "$c" in - a) - l1="$l1 " - l2="$l2 _ " - l3="$l3 (_|" - l4="$l4 " - ;; - b) - l1="$l1 " - l2="$l2 |_ " - l3="$l3 |_)" - l4="$l4 " - ;; - c) - l1="$l1 " - l2="$l2 _" - l3="$l3 (_" - l4="$l4 " - ;; - d) - l1="$l1 " - l2="$l2 _|" - l3="$l3 (_|" - l4="$l4 " - ;; - e) - l1="$l1 " - l2="$l2 _ " - l3="$l3 (/_" - l4="$l4 " - ;; - f) - l1="$l1 _" - l2="$l2 /_" - l3="$l3 | " - l4="$l4 " - ;; - g) - l1="$l1 " - l2="$l2 _ " - l3="$l3 (_|" - l4="$l4 _|" - ;; - h) - l1="$l1 " - l2="$l2 |_ " - l3="$l3 | |" - l4="$l4 " - ;; - i) - l1="$l1 " - l2="$l2 ." - l3="$l3 |" - l4="$l4 " - ;; - j) - l1="${l1} " - l2="${l2} ." - l3="${l3} |" - l4="${l4}_|" - ;; - k) - l1="$l1 " - l2="$l2 | " - l3="$l3 |<" - l4="$l4 " - ;; - l) - l1="$l1 " - l2="$l2 |" - l3="$l3 |" - l4="$l4 " - ;; - m) - l1="$l1 " - l2="$l2 __ " - l3="$l3 |||" - l4="$l4 " - ;; - n) - l1="$l1 " - l2="$l2 __ " - l3="$l3 | |" - l4="$l4 " - ;; - o) - l1="$l1 " - l2="$l2 _ " - l3="$l3 (_)" - l4="$l4 " - ;; - p) - l1="$l1 " - l2="$l2 _ " - l3="$l3 |_)" - l4="$l4 | " - ;; - q) - l1="$l1 " - l2="$l2 _ " - l3="$l3 (_|" - l4="$l4 |" - ;; - r) - l1="$l1 " - l2="$l2 _" - l3="$l3 | " - l4="$l4 " - ;; - s) - l1="$l1 " - l2="$l2 _" - l3="$l3 _\\" - l4="$l4 " - ;; - t) - l1="$l1 " - l2="$l2 |_" - l3="$l3 | " - l4="$l4 " - ;; - u) - l1="$l1 " - l2="$l2 " - l3="$l3 |_|" - l4="$l4 " - ;; - v) - l1="$l1 " - l2="$l2 " - l3="$l3 \\/" - l4="$l4 " - ;; - w) - l1="$l1 " - l2="$l2 " - l3="$l3 \\/\\/" - l4="$l4 " - ;; - x) - l1="$l1 " - l2="$l2 ., " - l3="$l3 /\\ " - l4="$l4 " - ;; - y) - l1="$l1 " - l2="$l2 " - l3="$l3 \\/" - l4="$l4 / " - ;; - z) - l1="$l1 " - l2="$l2 _ " - l3="$l3 /_" - l4="$l4 " - ;; - A) - l1="$l1 " - l2="$l2 /\\ " - l3="$l3 /--\\" - l4="$l4 " - ;; - B) - l1="$l1 _ " - l2="$l2 |_)" - l3="$l3 |_)" - l4="$l4 " - ;; - C) - l1="$l1 _" - l2="$l2 / " - l3="$l3 \\_" - l4="$l4 " - ;; - D) - l1="$l1 _ " - l2="$l2 | \\" - l3="$l3 |_/" - l4="$l4 " - ;; - E) - l1="$l1 __" - l2="$l2 |_ " - l3="$l3 |__" - l4="$l4 " - ;; - F) - l1="$l1 __" - l2="$l2 |_ " - l3="$l3 | " - l4="$l4 " - ;; - G) - l1="$l1 __" - l2="$l2 / _" - l3="$l3 \\_|" - l4="$l4 " - ;; - H) - l1="$l1 " - l2="$l2 |_|" - l3="$l3 | |" - l4="$l4 " - ;; - I) - l1="$l1 ___" - l2="$l2 | " - l3="$l3 _|_" - l4="$l4 " - ;; - J) - l1="$l1 __" - l2="$l2 |" - l3="$l3 \\_|" - l4="$l4 " - ;; - K) - l1="$l1 " - l2="$l2 |_/" - l3="$l3 | \\" - l4="$l4 " - ;; - L) - l1="$l1 " - l2="$l2 | " - l3="$l3 |__" - l4="$l4 " - ;; - M) - l1="$l1 " - l2="$l2 |\\/|" - l3="$l3 | |" - l4="$l4 " - ;; - N) - l1="$l1 " - l2="$l2 |\\ |" - l3="$l3 | \\|" - l4="$l4 " - ;; - O) - l1="$l1 __ " - l2="$l2 / \\" - l3="$l3 \\__/" - l4="$l4 " - ;; - P) - l1="$l1 __ " - l2="$l2 |_)" - l3="$l3 | " - l4="$l4 " - ;; - Q) - l1="$l1 __ " - l2="$l2 / \\" - l3="$l3 \\__\\" - l4="$l4 " - ;; - R) - l1="$l1 __ " - l2="$l2 |_)" - l3="$l3 | \\" - l4="$l4 " - ;; - S) - l1="$l1 __" - l2="$l2 (_ " - l3="$l3 __)" - l4="$l4 " - ;; - T) - l1="$l1 ___" - l2="$l2 | " - l3="$l3 | " - l4="$l4 " - ;; - U) - l1="$l1 " - l2="$l2 | |" - l3="$l3 |_|" - l4="$l4 " - ;; - V) - l1="$l1 " - l2="$l2 \\ /" - l3="$l3 \\/ " - l4="$l4 " - ;; - W) - l1="$l1 " - l2="$l2 \\ \\ /" - l3="$l3 \\/\\/ " - l4="$l4 " - ;; - X) - l1="$l1 " - l2="$l2 \\_/ " - l3="$l3 / \\ " - l4="$l4 " - ;; - Y) - l1="$l1 " - l2="$l2 \\/" - l3="$l3 / " - l4="$l4 " - ;; - Z) - l1="$l1 __" - l2="$l2 /" - l3="$l3 /_" - l4="$l4 " - ;; - 0) - l1="$l1 _ " - l2="$l2 / \\" - l3="$l3 \\_/" - l4="$l4 " - ;; - 1) - l1="$l1 " - l2="$l2 /|" - l3="$l3 |" - l4="$l4 " - ;; - 2) - l1="$l1 _ " - l2="$l2 ' )" - l3="$l3 /_" - l4="$l4 " - ;; - 3) - l1="$l1 _ " - l2="$l2 _)" - l3="$l3 _)" - l4="$l4 " - ;; - 4) - l1="$l1 " - l2="$l2 /_|" - l3="$l3 |" - l4="$l4 " - ;; - 5) - l1="$l1 _ " - l2="$l2 |_ " - l3="$l3 _)" - l4="$l4 " - ;; - 6) - l1="$l1 " - l2="$l2 / " - l3="$l3 (_)" - l4="$l4 " - ;; - 7) - l1="$l1 __" - l2="$l2 /" - l3="$l3 / " - l4="$l4 " - ;; - 8) - l1="$l1 _ " - l2="$l2 (_)" - l3="$l3 (_)" - l4="$l4 " - ;; - 9) l1="$l1 _ " - l2="$l2 ( )" - l3="$l3 / " - l4="$l4 " - ;; - .) l1="$l1 " - l2="$l2 " - l3="$l3 ." - l4="$l4 " - ;; - ,) l1="$l1 " - l2="$l2 " - l3="$l3 " - l4="$l4 /" - ;; - :) l1="$l1 " - l2="$l2 ." - l3="$l3 ." - l4="$l4 " - ;; - \;) l1="$l1 " - l2="$l2 ." - l3="$l3 ." - l4="$l4 " - ;; - !) l1="$l1 |" - l2="$l2 |" - l3="$l3 ." - l4="$l4 " - ;; - \?) l1="$l1 _ " - l2="$l2 ' ) " - l3="$l3 ' " - l4="$l4 ' " - ;; - \') l1="$l1 " - l2="$l2 |" - l3="$l3 " - l4="$l4 " - ;; - \`) l1="$l1 " - l2="$l2 \ " - l3="$l3 " - l4="$l4 " - ;; - \") l1="$l1 " - l2="$l2 ||" - l3="$l3 " - l4="$l4 " - ;; - @) l1="$l1 __ " - l2="$l2 | _|" - l3="$l3 ||_|" - l4="$l4 \`-- " - ;; - \<) l1="$l1 " - l2="$l2 /" - l3="$l3 ( " - l4="$l4 \\" - ;; - \*) l1="$l1 " - l2="$l2 _\\/_" - l3="$l3 /\\ " - l4="$l4 " - ;; - \#) l1="$l1 " - l2="$l2 -|-|-" - l3="$l3 -|-|-" - l4="$l4 " - ;; - \~) l1="$l1 _ " - l2="$l2 / \\_/" - l3="$l3 " - l4="$l4 " - ;; - \>) l1="$l1 " - l2="$l2 \\ " - l3="$l3 )" - l4="$l4 / " - ;; - -) l1="$l1 " - l2="$l2 " - l3="$l3 --" - l4="$l4 " - ;; - _) l1="$l1 " - l2="$l2 " - l3="$l3 ___" - l4="$l4 " - ;; - /) l1="$l1 " - l2="$l2 /" - l3="$l3 / " - l4="$l4 " - ;; - \\) l1="$l1 " - l2="$l2 \\ " - l3="$l3 \\" - l4="$l4 " - ;; - *) l1="$l1 " - l2="$l2 " - l3="$l3 " - l4="$l4 " - ;; - esac - done - - [ "$l1" ] && printf '%s\n' "$l1" - [ "$l2" ] && printf '%s\n' "$l2" - [ "$l3" ] && printf '%s\n' "$l3" - [ "$l4" ] && printf '%s\n' "$l4" -} | sed 's/ *$//' diff --git a/bin/fig-2 b/bin/fig-2 @@ -1,517 +0,0 @@ -# figlet without all the bells and fanciness. - -if [ $# = 0 ] -then - tee -else - printf '%s\n' "$*" -fi | fold -w 1 | { - while IFS= read -r c - do - case "$c" in - a) - l1="$l1"' ' - l2="$l2"' ,--.' - l3="$l3"' ,--|' - l4="$l4"' `--`' - l5="$l5"' ' - ;; - b) - l1="$l1"' | ' - l2="$l2"' |--.' - l3="$l3"' | |' - l4="$l4"" '--'" - l5="$l5"' ' - ;; - c) - l1="$l1"' ' - l2="$l2"' ,--.' - l3="$l3"' | ' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - d) - l1="$l1"' |' - l2="$l2"' .--|' - l3="$l3"' | |' - l4="$l4"' `--`' - l5="$l5"' ' - ;; - e) - l1="$l1"' ' - l2="$l2"' ,--.' - l3="$l3"" |--'" - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - f) - l1="$l1"' ,--' - l2="$l2"' |- ' - l3="$l3"' | ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - g) - l1="$l1"' ' - l2="$l2"' ,--,' - l3="$l3"' | |' - l4="$l4"' `--|' - l5="$l5"" \`--'" - ;; - h) - l1="$l1"' | ' - l2="$l2"' |--.' - l3="$l3"' | |' - l4="$l4"" ' '" - l5="$l5"' ' - ;; - i) - l1="$l1"" ." - l2="$l2"' ,' - l3="$l3"' |' - l4="$l4"" '" - l5="$l5"' ' - ;; - j) - l1="$l1"" ." - l2="$l2"' ,' - l3="$l3"' |' - l4="$l4"' |' - l5="$l5"" \`-'" - ;; - k) - l1="$l1"' | ' - l2="$l2"' | ,' - l3="$l3"' |-< ' - l4="$l4"" ' \`" - l5="$l5"' ' - ;; - l) - l1="$l1"' |' - l2="$l2"' |' - l3="$l3"' |' - l4="$l4"" '" - l5="$l5"' ' - ;; - m) - l1="$l1"' ' - l2="$l2"' --.-.' - l3="$l3"' | | |' - l4="$l4"" ' ' '" - l5="$l5"' ' - ;; - n) - l1="$l1"' ' - l2="$l2"' ---.' - l3="$l3"' | |' - l4="$l4"" ' '" - l5="$l5"' ' - ;; - o) - l1="$l1"' ' - l2="$l2"' ,--.' - l3="$l3"' | |' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - p) - l1="$l1"' ' - l2="$l2"' ---.' - l3="$l3"' | |' - l4="$l4"" |--'" - l5="$l5"' | ' - ;; - q) - l1="$l1"' ' - l2="$l2"' ,---' - l3="$l3"' | |' - l4="$l4"' `--|' - l5="$l5"' |' - ;; - r) - l1="$l1"' ' - l2="$l2"' .,--' - l3="$l3"' | ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - s) - l1="$l1"' ' - l2="$l2"' ,---' - l3="$l3"' `--.' - l4="$l4"" ---'" - l5="$l5"' ' - ;; - t) - l1="$l1"' | ' - l2="$l2"' |--' - l3="$l3"' | ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - u) - l1="$l1"' ' - l2="$l2"' , ,' - l3="$l3"' | |' - l4="$l4"' `--`' - l5="$l5"' ' - ;; - v) - l1="$l1"' ' - l2="$l2"' . ,' - l3="$l3"' \ / ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - w) - l1="$l1"' ' - l2="$l2"' , , ,' - l3="$l3"' | | |' - l4="$l4"" \`-'-'" - l5="$l5"' ' - ;; - x) - l1="$l1"' ' - l2="$l2"' . ,' - l3="$l3"' >< ' - l4="$l4"" ' \`" - l5="$l5"' ' - ;; - y) - l1="$l1"' ' - l2="$l2"' , ,' - l3="$l3"' | |' - l4="$l4"' `--|' - l5="$l5"" \`--'" - ;; - z) - l1="$l1"' ' - l2="$l2"' ---,' - l3="$l3"" ,' " - l4="$l4"" '---" - l5="$l5"' ' - ;; - A) - l1="$l1"' ,--.' - l2="$l2"' |__|' - l3="$l3"' | |' - l4="$l4"" ' '" - l5="$l5"' ' - ;; - B) - l1="$l1"' ---.' - l2="$l2"' |__/' - l3="$l3"' | \' - l4="$l4"" ---'" - l5="$l5"' ' - ;; - C) - l1="$l1"' ,--.' - l2="$l2"' | ' - l3="$l3"' | ' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - D) - l1="$l1"' ---.' - l2="$l2"' | |' - l3="$l3"' | |' - l4="$l4"" ---'" - l5="$l5"' ' - ;; - E) - l1="$l1"' ----' - l2="$l2"' |__ ' - l3="$l3"' | ' - l4="$l4"' ----' - l5="$l5"' ' - ;; - F) - l1="$l1"' ----' - l2="$l2"' |__ ' - l3="$l3"' | ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - G) - l1="$l1"' ,--.' - l2="$l2"' | ' - l3="$l3"' | -.' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - H) - l1="$l1"' , ,' - l2="$l2"' |__|' - l3="$l3"' | |' - l4="$l4"" ' '" - l5="$l5"' ' - ;; - I) - l1="$l1"' ---' - l2="$l2"' | ' - l3="$l3"' | ' - l4="$l4"' ---' - l5="$l5"' ' - ;; - J) - l1="$l1"' ---' - l2="$l2"' | ' - l3="$l3"' | ' - l4="$l4"" \`-' " - l5="$l5"' ' - ;; - K) - l1="$l1"' . ,' - l2="$l2"" |,' " - l3="$l3"' |`. ' - l4="$l4"" ' \`" - l5="$l5"' ' - ;; - L) - l1="$l1"' , ' - l2="$l2"' | ' - l3="$l3"' | ' - l4="$l4"" '---" - l5="$l5"' ' - ;; - M) - l1="$l1"' . .' - l2="$l2"' |\ /|' - l3="$l3"' | | |' - l4="$l4"" ' '" - l5="$l5"' ' - ;; - N) - l1="$l1"' . .' - l2="$l2"' |\ |' - l3="$l3"' | \|' - l4="$l4"" ' '" - l5="$l5"' ' - ;; - O) - l1="$l1"' ,--.' - l2="$l2"' | |' - l3="$l3"' | |' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - P) - l1="$l1"' ---.' - l2="$l2"" |__'" - l3="$l3"' | ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - Q) - l1="$l1"' ,--.' - l2="$l2"' | |' - l3="$l3"' | |' - l4="$l4"' `--\' - l5="$l5"' ' - ;; - R) - l1="$l1"' ---.' - l2="$l2"" |__'" - l3="$l3"' |`. ' - l4="$l4"" ' \`" - l5="$l5"' ' - ;; - S) - l1="$l1"' ,--.' - l2="$l2"' `. ' - l3="$l3"' `.' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - T) - l1="$l1"' ----' - l2="$l2"' | ' - l3="$l3"' | ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - U) - l1="$l1"' , ,' - l2="$l2"' | |' - l3="$l3"' | |' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - V) - l1="$l1"' . .' - l2="$l2"' | / ' - l3="$l3"' |/ ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - W) - l1="$l1"' , ,' - l2="$l2"' | . |' - l3="$l3"' |/ \|' - l4="$l4"" ' \`" - l5="$l5"' ' - ;; - X) - l1="$l1"' . ,' - l2="$l2"' \/ ' - l3="$l3"' /\ ' - l4="$l4"" ' \`" - l5="$l5"' ' - ;; - Y) - l1="$l1"' . ,' - l2="$l2"" \`.' " - l3="$l3"' | ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - Z) - l1="$l1"' ---,' - l2="$l2"' / ' - l3="$l3"' / ' - l4="$l4"" '---" - l5="$l5"' ' - ;; - 0) - l1="$l1"' ,--.' - l2="$l2"' |\ |' - l3="$l3"' | \|' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - 1) - l1="$l1"' , ' - l2="$l2"" '| " - l3="$l3"' | ' - l4="$l4"" -'-" - l5="$l5"' ' - ;; - 2) - l1="$l1"' ,--.' - l2="$l2"" ,'" - l3="$l3"' / ' - l4="$l4"' ----' - l5="$l5"' ' - ;; - 3) - l1="$l1"' ,--.' - l2="$l2"' __/' - l3="$l3"' \' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - 4) - l1="$l1"' , ' - l2="$l2"' / ' - l3="$l3"" '-+-" - l4="$l4"" ' " - l5="$l5"' ' - ;; - 5) - l1="$l1"' .---' - l2="$l2"' |__ ' - l3="$l3"' \' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - 6) - l1="$l1"' ,--.' - l2="$l2"' |__ ' - l3="$l3"' | |' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - 7) - l1="$l1"' ----' - l2="$l2"' _/' - l3="$l3"' / ' - l4="$l4"" ' " - l5="$l5"' ' - ;; - 8) - l1="$l1"' ,--.' - l2="$l2"' \__/' - l3="$l3"' / \' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - 9) - l1="$l1"' ,--.' - l2="$l2"' \__|' - l3="$l3"' |' - l4="$l4"" \`--'" - l5="$l5"' ' - ;; - .) - l1="$l1"" " - l2="$l2"" " - l3="$l3"" " - l4="$l4"" '" - l5="$l5"" " - ;; - '`') - l1="$l1"' \ ' - l2="$l2"' \' - l3="$l3"' ' - l4="$l4"' ' - l5="$l5"' ' - ;; - "'") - l1="$l1"' |' - l2="$l2"' |' - l3="$l3"' ' - l4="$l4"' ' - l5="$l5"' ' - ;; - '"') - l1="$l1"' | |' - l2="$l2"' | |' - l3="$l3"' ' - l4="$l4"' ' - l5="$l5"' ' - ;; - ' ') - l1="$l1"' ' - l2="$l2"' ' - l3="$l3"' ' - l4="$l4"' ' - l5="$l5"' ' - ;; - :) - l1="$l1"" " - l2="$l2"" ' " - l3="$l3"" " - l4="$l4"" ' " - l5="$l5"" " - ;; - /) - l1="$l1"' ' - l2="$l2"' /' - l3="$l3"' / ' - l4="$l4"'/ ' - l5="$l5"' ' - ;; - !) - l1="$l1"' |' - l2="$l2"' |' - l3="$l3"' |' - l4="$l4"' .' - l5="$l5"' ' - ;; - -) - l1="$l1"' ' - l2="$l2"' ' - l3="$l3"' ---' - l4="$l4"' ' - l5="$l5"' ' - ;; - esac - done - - [ "$l1" ] && printf '%s\n' "$l1" - [ "$l2" ] && printf '%s\n' "$l2" - [ "$l3" ] && printf '%s\n' "$l3" - [ "$l4" ] && printf '%s\n' "$l4" - [ "$l5" ] && printf '%s\n' "$l5" -} | sed 's/ *$//' diff --git a/build/st b/build/st @@ -1,3 +1,9 @@ # Simple terminal tar=http://dl.suckless.org/st/st-0.6.tar.gz + +build() +{ + sed 's/gray90/#ffeecc/' config.def.h > config.h + make PREFIX="$PREFIX" install +} diff --git a/build/vis b/build/vis @@ -6,7 +6,15 @@ build() { cp -f "$CONFIG/vis/config.h" config.h - ./configure --disable-lua --disable-lpeg --prefix="$PREFIX" CFLAGS="$CFLAGS" && + ./configure CFLAGS="-I$LOCAL/include -L$LOCAL/lib" \ + --disable-curses \ + --disable-lua \ + --disable-lpeg \ + --disable-lpeg-static \ + --disable-acl \ + --disable-selinux \ + --disable-tre \ + --prefix="$PREFIX" && make install } diff --git a/fig/1 b/fig/1 @@ -0,0 +1,491 @@ +a + ; + _ ; +(_|; + ; + +b + ; +|_ ; +|_); + ; + +c + ; + _; +(_; + ; + +d + ; + _|; +(_|; + ; + +e + ; + _ ; +(/_; + ; + +f + _; +/_; +| ; + ; + +g + ; + _ ; +(_|; + _|; + +h + ; +|_ ; +| |; + ; + +i + ; +.; +|; + ; + +j + ; + .; + |; +_|; + +k + ; +| ; +|<; + ; + +l + ; +|; +|; + ; + +m + ; +__ ; +|||; + ; + +n + ; +__ ; +| |; + ; + +o + ; + _ ; +(_); + ; + +p + ; + _ ; +|_); +| ; + +q + ; + _ ; +(_|; + |; + +r + ; + _; +| ; + ; + +s + ; + _; +_\; + ; + +t + ; +|_; +| ; + ; + +u + ; + ; +|_|; + ; + +v + ; + ; +\/; + ; + +w + ; + ; +\/\/; + ; + +x + ; +., ; +/\ ; + ; + +y + ; + ; +\/; +/ ; + +z + ; +_ ; +/_; + ; + +A + ; + /\ ; +/--\; + ; + +B + _ ; +|_); +|_); + ; + +C + _; +/ ; +\_; + ; + +D + _ ; +| \; +|_/; + ; + +E + __; +|_ ; +|__; + ; + +F + __; +|_ ; +| ; + ; + +G + __; +/ _; +\_|; + ; + +H + ; +|_|; +| |; + ; + +I +___; + | ; +_|_; + ; + +J + __; + |; +\_|; + ; + +K + ; +|_/; +| \; + ; + +L + ; +| ; +|__; + ; + +M + ; +|\/|; +| |; + ; + +N + ; +|\ |; +| \|; + ; + +O + __ ; +/ \; +\__/; + ; + +P +__ ; +|_); +| ; + ; + +Q + __ ; +/ \; +\__\; + ; + +R +__ ; +|_); +| \; + ; + +S + __; +(_ ; +__); + ; + +T +___; + | ; + | ; + ; + +U + ; +| |; +|_|; + ; + +V + ; +\ /; + \/ ; + ; + +W + ; +\ \ /; + \/\/ ; + ; + +X + ; +\_/ ; +/ \ ; + ; + +Y + ; +\/; +/ ; + ; + +Z +__; + /; +/_; + ; + +0 + _ ; +/ \; +\_/; + ; + +1 + ; +/|; + |; + ; + +2 + _ ; +' ); + /_; + ; + +3 +_ ; +_); +_); + ; + +4 + ; +/_|; + |; + ; + +5 + _ ; +|_ ; + _); + ; + +6 + ; + / ; +(_); + ; + +7 +__; + /; +/ ; + ; + +8 + _ ; +(_); +(_); + ; + +9 + _ ; +( ); + / ; + ; + +. + ; + ; +.; + ; + +, + ; + ; + ; +/; + +: + ; +.; +.; + ; + +; + ; +.; +.; + ; + +! +|; +|; +.; + ; + +? + _ ; +' ) ; + ' ; + ' ; + +' + ; +|; + ; + ; + +` + ; +\ ; + ; + ; + +" + ; +||; + ; + ; + +@ + __ ; +| _|; +||_|; +`-- ; + +< + ; + /; +( ; + \; + +* + ; +_\/_; + /\ ; + ; + +# + ; +-|-|-; +-|-|-; + ; + +~ + _ ; +/ \_/; + ; + ; + +> + ; +\ ; + ); +/ ; + +- + ; + ; +--; + ; + +_ + ; + ; +___; + ; + +/ + ; + /; +/ ; + ; + +\ + ; +\ ; + \; + ; + + + ; + ; + ; + ; diff --git a/fig/2 b/fig/2 @@ -0,0 +1,495 @@ +a + ; + ,--.; + ,--|; + `--`; + ; + +b + | ; + |--.; + | |; + '--'; + ; + +c + ; + ,--.; + | ; + `--'; + ; + +d + |; + .--|; + | |; + `--`; + ; + +e + ; + ,--.; + |--'; + `--'; + ; + +f + ,--; + |- ; + | ; + ; + +g + ; + ,--,; + | |; + `--|; + `--'; + +h + | ; + |--.; + | |; + ' '; + ; + +i + .; + ,; + |; + '; + ; + +j + .; + ,; + |; + |; + `-'; + +k + | ; + | ,; + |-< ; + ' `; + ; + +l + |; + |; + |; + '; + ; + +m + ; + --.-.; + | | |; + ' ' '; + ; + +n + ; + ---.; + | |; + ' '; + ; + +o + ; + ,--.; + | |; + `--'; + ; + +p + ; + ---.; + | |; + |--'; + | ; + +q + ; + ,---; + | |; + `--|; + |; + +r + ; + .,--; + | ; + ' ; + ; + +s + ; + ,---; + `--.; + ---'; + ; + +t + | ; + |--; + | ; + ' ; + ; + +u + ; + , ,; + | |; + `--`; + ; + +v + ; + . ,; + \ / ; + ' ; + ; + +w + ; + , , ,; + | | |; + `-'-'; + ; + +x + ; + . ,; + >< ; + ' `; + ; + +y + ; + , ,; + | |; + `--|; + `--'; + +z + ; + ---,; + ,' ; + '---; + ; + +A + ,--.; + |__|; + | |; + ' '; + ; + +B + ---.; + |__/; + | \; + ---'; + ; + +C + ,--.; + | ; + | ; + `--'; + ; + +D + ---.; + | |; + | |; + ---'; + ; + +E + ----; + |__ ; + | ; + ----; + ; + +F + ----; + |__ ; + | ; + ' ; + ; + +G + ,--.; + | ; + | -.; + `--'; + ; + +H + , ,; + |__|; + | |; + ' '; + ; + +I + ---; + | ; + | ; + ---; + ; + +J + ---; + | ; + | ; + `-' ; + ; + +K + . ,; + |,' ; + |`. ; + ' `; + ; + +L + , ; + | ; + | ; + '---; + ; + +M + . .; + |\ /|; + | | |; + ' '; + ; + +N + . .; + |\ |; + | \|; + ' '; + ; + +O + ,--.; + | |; + | |; + `--'; + ; + +P + ---.; + |__'; + | ; + ' ; + ; + +Q + ,--.; + | |; + | |; + `--\; + ; + +R + ---.; + |__'; + |`. ; + ' `; + ; + +S + ,--.; + `. ; + `.; + `--'; + ; + +T + ----; + | ; + | ; + ' ; + ; + +U + , ,; + | |; + | |; + `--'; + ; + +V + . .; + | / ; + |/ ; + ' ; + ; + +W + , ,; + | . |; + |/ \|; + ' `; + ; + +X + . ,; + \/ ; + /\ ; + ' `; + ; + +Y + . ,; + `.' ; + | ; + ' ; + ; + +Z + ---,; + / ; + / ; + '---; + ; + +0 + ,--.; + |\ |; + | \|; + `--'; + ; + +1 + , ; + /| ; + | ; + -'-; + ; + +2 + ,--.; + ,'; + / ; + ----; + ; + +3 + ,--.; + __/; + \; + `--'; + ; + +4 + , ; + / ; + '-+-; + ' ; + ; + +5 + .---; + |__ ; + \; + `--'; + ; + +6 + ,--.; + |__ ; + | |; + `--'; + ; + +7 + ----; + _/; + / ; + ' ; + ; + +8 + ,--.; + \__/; + / \; + `--'; + ; + +9 + ,--.; + \__|; + |; + `--'; + ; + +. + ; + ; + '; + ; + ; + +` + \ ; + \; + ; + ; + ; + +' + |; + |; + ; + ; + ; + +" + | |; + | |; + ; + ; + ; + +' +| ; + ; + ; + ; + ; + +: + ; + ' ; + ; + ' ; + ; + +/ + ; + /; + / ; +/ ; + ; + +! + |; + |; + |; + .; + ; + +- + ; + ; + ---; + ; + ; diff --git a/vis/config.h b/vis/config.h @@ -1,404 +0,0 @@ -/* Configure your desired default key bindings. */ - -#define ALIAS(name) .alias = name, -#define ACTION(id) .action = &vis_action[VIS_ACTION_##id], - -static const char *keymaps[] = { - NULL -}; - -static const KeyBinding bindings_basic[] = { - { "<C-z>", ACTION(EDITOR_SUSPEND) }, - { "<Down>", ACTION(CURSOR_LINE_DOWN) }, - { "<End>", ACTION(CURSOR_LINE_END) }, - { "<Home>", ACTION(CURSOR_LINE_BEGIN) }, - { "<Left>", ACTION(CURSOR_CHAR_PREV) }, - { "<PageDown>", ACTION(WINDOW_PAGE_DOWN) }, - { "<PageUp>", ACTION(WINDOW_PAGE_UP) }, - { "<Right>", ACTION(CURSOR_CHAR_NEXT) }, - { "<S-Left>", ACTION(CURSOR_LONGWORD_START_PREV) }, - { "<S-PageDown>", ACTION(WINDOW_HALFPAGE_DOWN) }, - { "<S-PageUp>", ACTION(WINDOW_HALFPAGE_UP) }, - { "<S-Right>", ACTION(CURSOR_LONGWORD_START_NEXT) }, - { "<Up>", ACTION(CURSOR_LINE_UP) }, - /* custom keybindings */ - { "<M-<>", ACTION(CURSOR_LINE_FIRST) }, - { "<M->>", ACTION(CURSOR_LINE_LAST) }, - { "<M-v>", ACTION(WINDOW_PAGE_UP) }, - { "<C-v>", ACTION(WINDOW_PAGE_DOWN) }, - { "<M-{>", ACTION(CURSOR_PARAGRAPH_PREV) }, - { "<M-}>", ACTION(CURSOR_PARAGRAPH_NEXT) }, - { "<C-p>", ACTION(CURSOR_LINE_UP) }, - { "<C-n>", ACTION(CURSOR_LINE_DOWN) }, - { "<M-a>", ACTION(CURSOR_SENTENCE_PREV) }, - { "<M-e>", ACTION(CURSOR_SENTENCE_NEXT) }, - { "<C-a>", ACTION(CURSOR_LINE_BEGIN) }, - { "<C-e>", ACTION(CURSOR_LINE_END) }, - { "<M-b>", ACTION(CURSOR_WORD_START_PREV) }, - { "<M-f>", ACTION(CURSOR_WORD_END_NEXT) }, - { "<C-b>", ACTION(CURSOR_CHAR_PREV) }, - { "<C-f>", ACTION(CURSOR_CHAR_NEXT) }, - - { "<C-o>", ACTION(OPEN_LINE_ABOVE) }, - { "<C-y>", ACTION(PUT_BEFORE) }, - - { "<C-l>", ACTION(WINDOW_REDRAW_CENTER) }, - - { "<C-_>", ACTION(UNDO) }, - - { "<C-k>", ALIAS("<Escape>d$i") }, - { "<M-d>", ALIAS("<Escape>dei") }, - { "<C-d>", ACTION(DELETE_CHAR_NEXT) }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_motions[] = { - { "|", ACTION(CURSOR_COLUMN) }, - { "[{", ACTION(CURSOR_BLOCK_START) }, - { "]}", ACTION(CURSOR_BLOCK_END) }, - { "[(", ACTION(CURSOR_PARENTHESE_START) }, - { "])", ACTION(CURSOR_PARENTHESE_END) }, - { "$", ACTION(CURSOR_LINE_END) }, - { "^", ACTION(CURSOR_LINE_START) }, - { "}", ACTION(CURSOR_PARAGRAPH_NEXT) }, - { "{", ACTION(CURSOR_PARAGRAPH_PREV) }, - { "%", ACTION(CURSOR_PERCENT) }, - { "#", ACTION(CURSOR_SEARCH_WORD_BACKWARD) }, - { "*", ACTION(CURSOR_SEARCH_WORD_FORWARD) }, - { ")", ACTION(CURSOR_SENTENCE_NEXT) }, - { "(", ACTION(CURSOR_SENTENCE_PREV) }, - { "`", ACTION(MARK_GOTO) }, - { "'", ACTION(MARK_GOTO_LINE) }, - { "?", ACTION(PROMPT_SEARCH_BACKWARD) }, - { "/", ACTION(PROMPT_SEARCH_FORWARD) }, - { ";", ACTION(TOTILL_REPEAT) }, - { ",", ACTION(TOTILL_REVERSE) }, - { "+", ALIAS("j^") }, - { "-", ALIAS("k^") }, - { " ", ALIAS("<Space>") }, - { "<Space>", ALIAS("l") }, - { "<Backspace>", ALIAS("h") }, - { "B", ACTION(CURSOR_LONGWORD_START_PREV) }, - { "b", ACTION(CURSOR_WORD_START_PREV) }, - { "<C-h>", ALIAS("<Backspace>") }, - { "<C-j>", ALIAS("j") }, - { "<C-n>", ALIAS("j") }, - { "<C-p>", ALIAS("k") }, - { "E", ACTION(CURSOR_LONGWORD_END_NEXT) }, - { "e", ACTION(CURSOR_WORD_END_NEXT) }, - { "<Enter>", ALIAS("j") }, - { "F", ACTION(TO_LEFT) }, - { "f", ACTION(TO_RIGHT) }, - { "go", ACTION(CURSOR_BYTE) }, - { "gh", ACTION(CURSOR_BYTE_LEFT) }, - { "gl", ACTION(CURSOR_BYTE_RIGHT) }, - { "g0", ACTION(CURSOR_SCREEN_LINE_BEGIN) }, - { "g_", ACTION(CURSOR_LINE_FINISH) }, - { "G", ACTION(CURSOR_LINE_LAST) }, - { "g$", ACTION(CURSOR_SCREEN_LINE_END) }, - { "g<Down>", ALIAS("gj") }, - { "gE", ACTION(CURSOR_LONGWORD_END_PREV) }, - { "ge", ACTION(CURSOR_WORD_END_PREV) }, - { "gg", ACTION(CURSOR_LINE_FIRST) }, - { "gj", ACTION(CURSOR_SCREEN_LINE_DOWN) }, - { "gk", ACTION(CURSOR_SCREEN_LINE_UP) }, - { "gm", ACTION(CURSOR_SCREEN_LINE_MIDDLE) }, - { "g<Up>", ALIAS("gk") }, - { "h", ACTION(CURSOR_CHAR_PREV) }, - { "H", ACTION(CURSOR_WINDOW_LINE_TOP) }, - { "j", ACTION(CURSOR_LINE_DOWN) }, - { "k", ACTION(CURSOR_LINE_UP) }, - { "l", ACTION(CURSOR_CHAR_NEXT) }, - { "L", ACTION(CURSOR_WINDOW_LINE_BOTTOM) }, - { "M", ACTION(CURSOR_WINDOW_LINE_MIDDLE) }, - { "n", ACTION(CURSOR_SEARCH_REPEAT_FORWARD) }, - { "N", ACTION(CURSOR_SEARCH_REPEAT_BACKWARD) }, - { "T", ACTION(TILL_LEFT) }, - { "t", ACTION(TILL_RIGHT) }, - { "W", ACTION(CURSOR_LONGWORD_START_NEXT) }, - { "w", ACTION(CURSOR_WORD_START_NEXT) }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_textobjects[] = { - { "a<", ACTION(TEXT_OBJECT_ANGLE_BRACKET_OUTER) }, - { "a`", ACTION(TEXT_OBJECT_BACKTICK_OUTER) }, - { "a{", ACTION(TEXT_OBJECT_CURLY_BRACKET_OUTER) }, - { "a(", ACTION(TEXT_OBJECT_PARANTHESE_OUTER) }, - { "a\"", ACTION(TEXT_OBJECT_QUOTE_OUTER) }, - { "a\'", ACTION(TEXT_OBJECT_SINGLE_QUOTE_OUTER) }, - { "a[", ACTION(TEXT_OBJECT_SQUARE_BRACKET_OUTER) }, - { "a>", ALIAS("a<") }, - { "a)", ALIAS("a(") }, - { "a]", ALIAS("a[") }, - { "a}", ALIAS("a{") }, - { "ab", ALIAS("a(") }, - { "aB", ALIAS("a{") }, - { "ae", ACTION(TEXT_OBJECT_ENTIRE_OUTER) }, - { "al", ACTION(TEXT_OBJECT_LINE_OUTER) }, - { "ap", ACTION(TEXT_OBJECT_PARAGRAPH) }, - { "as", ACTION(TEXT_OBJECT_SENTENCE) }, - { "a<Tab>", ACTION(TEXT_OBJECT_INDENTATION) }, - { "aW", ACTION(TEXT_OBJECT_LONGWORD_OUTER) }, - { "aw", ACTION(TEXT_OBJECT_WORD_OUTER) }, - { "gN", ACTION(TEXT_OBJECT_SEARCH_BACKWARD) }, - { "gn", ACTION(TEXT_OBJECT_SEARCH_FORWARD) }, - { "i<", ACTION(TEXT_OBJECT_ANGLE_BRACKET_INNER) }, - { "i`", ACTION(TEXT_OBJECT_BACKTICK_INNER) }, - { "i{", ACTION(TEXT_OBJECT_CURLY_BRACKET_INNER) }, - { "i(", ACTION(TEXT_OBJECT_PARANTHESE_INNER) }, - { "i\"", ACTION(TEXT_OBJECT_QUOTE_INNER) }, - { "i\'", ACTION(TEXT_OBJECT_SINGLE_QUOTE_INNER) }, - { "i[", ACTION(TEXT_OBJECT_SQUARE_BRACKET_INNER) }, - { "i>", ALIAS("i<") }, - { "i)", ALIAS("i(") }, - { "i]", ALIAS("i[") }, - { "i}", ALIAS("i{") }, - { "ib", ALIAS("i(") }, - { "iB", ALIAS("i{") }, - { "ie", ACTION(TEXT_OBJECT_ENTIRE_INNER) }, - { "il", ACTION(TEXT_OBJECT_LINE_INNER) }, - { "ip", ACTION(TEXT_OBJECT_PARAGRAPH) }, - { "is", ACTION(TEXT_OBJECT_SENTENCE) }, - { "i<Tab>", ACTION(TEXT_OBJECT_INDENTATION) }, - { "iW", ACTION(TEXT_OBJECT_LONGWORD_INNER) }, - { "iw", ACTION(TEXT_OBJECT_WORD_INNER) }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_operators[] = { - { "0", ACTION(COUNT) }, - { "1", ACTION(COUNT) }, - { "2", ACTION(COUNT) }, - { "3", ACTION(COUNT) }, - { "4", ACTION(COUNT) }, - { "5", ACTION(COUNT) }, - { "6", ACTION(COUNT) }, - { "7", ACTION(COUNT) }, - { "8", ACTION(COUNT) }, - { "9", ACTION(COUNT) }, - { "~", ACTION(OPERATOR_CASE_SWAP) }, - { "!", ACTION(OPERATOR_FILTER) }, - { "=", ALIAS("gq") }, - { "<", ACTION(OPERATOR_SHIFT_LEFT) }, - { ">", ACTION(OPERATOR_SHIFT_RIGHT) }, - { "\"", ACTION(REGISTER) }, - { "c", ACTION(OPERATOR_CHANGE) }, - { "d", ACTION(OPERATOR_DELETE) }, - { "g~", ACTION(OPERATOR_CASE_SWAP) }, - { "gp", ACTION(PUT_AFTER_END) }, - { "gP", ACTION(PUT_BEFORE_END) }, - { "gq", ACTION(OPERATOR_FILTER_FMT) }, - { "gu", ACTION(OPERATOR_CASE_LOWER) }, - { "gU", ACTION(OPERATOR_CASE_UPPER) }, - { "p", ACTION(PUT_AFTER) }, - { "P", ACTION(PUT_BEFORE) }, - { "y", ACTION(OPERATOR_YANK) }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_operator_options[] = { - { "v", ACTION(MOTION_CHARWISE) }, - { "V", ACTION(MOTION_LINEWISE) }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_normal[] = { - { "a", ACTION(APPEND_CHAR_NEXT) }, - { "A", ACTION(APPEND_LINE_END) }, - { "@", ACTION(MACRO_REPLAY) }, - { ":", ACTION(PROMPT_SHOW) }, - { ".", ACTION(REPEAT) }, - { "~", ALIAS("<vis-operator-case-swap>ll") }, - { "C", ALIAS("c$") }, -/* { "<C-b>", ALIAS("<PageUp>") }, */ - { "<C-c>", ACTION(CURSORS_REMOVE_COLUMN) }, -/* { "<C-d>", ACTION(CURSORS_NEXT) }, */ -/* { "<C-e>", ACTION(WINDOW_SLIDE_UP) }, */ -/* { "<C-f>", ALIAS("<PageDown>") }, */ - { "<C-i>", ACTION(JUMPLIST_NEXT) }, - { "<C-j>", ACTION(CURSORS_NEW_LINE_BELOW) }, - { "<C-k>", ACTION(CURSORS_NEW_LINE_ABOVE) }, -/* { "<C-l>", ACTION(CURSORS_REMOVE_COLUMN_EXCEPT) }, */ -/* { "<C-n>", ACTION(CURSOR_SELECT_WORD) }, */ - { "<C-o>", ACTION(JUMPLIST_PREV) }, -/* { "<C-p>", ACTION(CURSORS_REMOVE_LAST) }, */ - { "<C-r>", ACTION(REDO) }, - { "<C-u>", ACTION(CURSORS_PREV) }, - { "<C-w><Backspace>", ALIAS("<C-w>k") }, - { "<C-w>c", ALIAS(":q<Enter>") }, - { "<C-w><C-h>", ALIAS("<C-w>k") }, - { "<C-w><C-j>", ALIAS("<C-w>j") }, - { "<C-w><C-k>", ALIAS("<C-w>k") }, - { "<C-w><C-l>", ALIAS("<C-w>j") }, - { "<C-w><C-w>", ALIAS("<C-w>j") }, - { "<C-w>h", ALIAS("<C-w>k") }, - { "<C-w>j", ACTION(WINDOW_NEXT) }, - { "<C-w>k", ACTION(WINDOW_PREV) }, - { "<C-w>l", ALIAS("<C-w>j") }, - { "<C-w>n", ALIAS(":open<Enter>") }, - { "<C-w>s", ALIAS(":split<Enter>") }, - { "<C-w>v", ALIAS(":vsplit<Enter>") }, - { "<C-w>w", ALIAS("<C-w>j") }, - { "<C-y>", ACTION(WINDOW_SLIDE_DOWN) }, - { "D", ALIAS("d$") }, - { "<Delete>", ALIAS("x") }, - { "<Escape>", ACTION(CURSORS_REMOVE_ALL) }, - { "<F1>", ALIAS(":help<Enter>") }, - { "ga", ACTION(UNICODE_INFO) }, - { "g8", ACTION(UTF8_INFO) }, - { "g,", ACTION(CHANGELIST_NEXT) }, - { "g;", ACTION(CHANGELIST_PREV) }, - { "g-", ACTION(EARLIER) }, - { "g+", ACTION(LATER) }, - { "gn", ALIAS("vgn") }, - { "gN", ALIAS("vgN") }, - { "gv", ACTION(SELECTION_RESTORE) }, - { "I", ACTION(INSERT_LINE_START) }, - { "i", ACTION(MODE_INSERT) }, - { "J", ACTION(JOIN_LINES) }, - { "gJ", ACTION(JOIN_LINES_TRIM) }, - { "m", ACTION(MARK_SET) }, - { "<M-C-j>", ACTION(CURSORS_NEW_LINE_BELOW_LAST) }, - { "<M-C-k>", ACTION(CURSORS_NEW_LINE_ABOVE_FIRST) }, - { "O", ACTION(OPEN_LINE_ABOVE) }, - { "o", ACTION(OPEN_LINE_BELOW) }, - { "q", ACTION(MACRO_RECORD) }, - { "R", ACTION(MODE_REPLACE) }, - { "r", ACTION(REPLACE_CHAR) }, - { "S", ALIAS("^c$") }, - { "s", ALIAS("cl") }, - { "<Tab>", ACTION(CURSORS_ALIGN) }, - { "u", ACTION(UNDO) }, - { "v", ACTION(MODE_VISUAL) }, - { "V", ACTION(MODE_VISUAL_LINE) }, - { "x", ACTION(DELETE_CHAR_NEXT) }, - { "X", ALIAS("dh") }, - { "Y", ALIAS("y$") }, - { "zb", ACTION(WINDOW_REDRAW_BOTTOM) }, - { "ZQ", ALIAS(":q!<Enter>") }, - { "zt", ACTION(WINDOW_REDRAW_TOP) }, - { "zz", ACTION(WINDOW_REDRAW_CENTER) }, - { "ZZ", ALIAS(":wq<Enter>") }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_visual[] = { - { "A", ACTION(CURSORS_NEW_LINES_END) }, - { "@", ACTION(MACRO_REPLAY) }, - { ":", ACTION(PROMPT_SHOW) }, - { "-", ACTION(SELECTIONS_ROTATE_LEFT) }, - { "+", ACTION(SELECTIONS_ROTATE_RIGHT) }, - { "\\", ACTION(SELECTIONS_TRIM) }, - { "<", ALIAS("<vis-operator-shift-left>gv") }, - { ">", ALIAS("<vis-operator-shift-right>gv") }, - { "<Backspace>", ALIAS("d") }, -/* { "<C-b>", ALIAS("<PageUp>") }, */ - { "<C-c>", ACTION(CURSORS_REMOVE_COLUMN) }, -/* { "<C-d>", ACTION(CURSORS_NEXT) }, */ -/* { "<C-f>", ALIAS("<PageDown>") }, */ - { "<C-h>", ALIAS("<Backspace>") }, - { "<C-j>", ALIAS("<C-d>") }, - { "<C-k>", ALIAS("<C-u>") }, -/* { "<C-l>", ACTION(CURSORS_REMOVE_COLUMN_EXCEPT) }, */ - { "<C-n>", ACTION(CURSORS_NEW_MATCH_NEXT) }, - { "<C-p>", ACTION(CURSORS_REMOVE_LAST) }, - { "<C-u>", ACTION(CURSORS_PREV) }, - { "<C-x>", ACTION(CURSORS_NEW_MATCH_SKIP) }, - { "<Delete>", ALIAS("<Backspace>") }, - { "<Escape>", ACTION(MODE_NORMAL) }, - { "I", ACTION(CURSORS_NEW_LINES_BEGIN) }, - { "J", ACTION(JOIN_LINES) }, - { "gJ", ACTION(JOIN_LINES_TRIM) }, - { "o", ACTION(SELECTION_FLIP) }, - { "q", ACTION(MACRO_RECORD) }, - { "r", ACTION(REPLACE_CHAR) }, - { "s", ALIAS("c") }, - { "<S-Tab>", ACTION(CURSORS_ALIGN_INDENT_RIGHT) }, - { "<Tab>", ACTION(CURSORS_ALIGN_INDENT_LEFT) }, - { "V", ACTION(MODE_VISUAL_LINE) }, - { "v", ALIAS("<Escape>") }, - { "x", ALIAS("d") }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_visual_line[] = { - { "v", ACTION(MODE_VISUAL) }, - { "V", ACTION(MODE_NORMAL) }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_readline[] = { - { "<Backspace>", ACTION(DELETE_CHAR_PREV) }, - { "<C-c>", ALIAS("<Escape>") }, - { "<C-d>", ACTION(DELETE_CHAR_NEXT) }, - { "<C-h>", ALIAS("<Backspace>") }, - { "<C-u>", ACTION(DELETE_LINE_BEGIN) }, - { "<C-q>", ACTION(INSERT_VERBATIM) }, - { "<C-w>", ACTION(DELETE_WORD_PREV) }, - { "<Delete>", ACTION(DELETE_CHAR_NEXT) }, - { "<Escape>", ACTION(MODE_NORMAL) }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_insert[] = { -/* { "<C-d>", ALIAS("<vis-operator-shift-left><vis-operator-shift-left>") }, */ - { "<C-i>", ALIAS("<Tab>") }, - { "<C-j>", ALIAS("<Enter>") }, - { "<C-m>", ALIAS("<Enter>") }, - { "<C-r>", ACTION(INSERT_REGISTER) }, - { "<C-t>", ALIAS("<vis-operator-shift-right><vis-operator-shift-right>") }, - { "<C-x><C-e>", ACTION(WINDOW_SLIDE_UP) }, - { "<C-x><C-y>", ACTION(WINDOW_SLIDE_DOWN) }, - { "<Enter>", ACTION(INSERT_NEWLINE) }, - { "<Escape>", ACTION(MODE_NORMAL) }, - { "<S-Tab>", ACTION(CURSORS_ALIGN_INDENT_LEFT) }, - { "<Tab>", ACTION(INSERT_TAB) }, - { 0 /* empty last element, array terminator */ }, -}; - -static const KeyBinding bindings_replace[] = { - { 0 /* empty last element, array terminator */ }, -}; - -/* For each mode we list a all key bindings, if a key is bound in more than - * one array the first definition is used and further ones are ignored. */ -static const KeyBinding **default_bindings[] = { - [VIS_MODE_OPERATOR_PENDING] = (const KeyBinding*[]){ - bindings_operator_options, - bindings_operators, - bindings_textobjects, - bindings_motions, - bindings_basic, - NULL, - }, - [VIS_MODE_NORMAL] = (const KeyBinding*[]){ - bindings_normal, - bindings_operators, - bindings_motions, - bindings_basic, - NULL, - }, - [VIS_MODE_VISUAL] = (const KeyBinding*[]){ - bindings_visual, - bindings_textobjects, - bindings_operators, - bindings_motions, - bindings_basic, - NULL, - }, - [VIS_MODE_VISUAL_LINE] = (const KeyBinding*[]){ - bindings_visual_line, - NULL, - }, - [VIS_MODE_INSERT] = (const KeyBinding*[]){ - bindings_insert, - bindings_readline, - bindings_basic, - NULL, - }, - [VIS_MODE_REPLACE] = (const KeyBinding*[]){ - bindings_replace, - NULL, - }, -};