adding @fingers-keyboard-layout option

This commit is contained in:
Jorge Morante 2019-01-14 08:41:21 +01:00
parent c9e9b8d941
commit a4e62e5648
3 changed files with 7 additions and 3 deletions

View File

@ -94,6 +94,8 @@ fingers_defaults=( \
[fingers-hint-position-nocompact]="right" \
[fingers-hint-format-nocompact]="#[fg=yellow,bold][%s]" \
[fingers-highlight-format-nocompact]="#[fg=yellow,nobold,dim]%s" \
[fingers-keyboard-layout]="qwerty" \
)
set_tmux_env 'fingers-patterns'
@ -109,6 +111,7 @@ set_tmux_env 'fingers-hint-position-nocompact'
set_tmux_env 'fingers-hint-format-nocompact' process_format
set_tmux_env 'fingers-highlight-format-nocompact' process_format
set_tmux_env 'fingers-keyboard-layout'
for option in fingers-{hint,highlight}-format{,-nocompact}; do
env_name="$(envify "$option")_NOCOLOR"

View File

@ -74,8 +74,7 @@ BEGIN {
}
END {
# TODO read alphabet root dir from ENVIRON
hints_path = "/home/morantron/hacking/tmux-fingers/alphabets/qwerty/" n_matches
hints_path = ENVIRON["FINGERS_ALPHABET_DIR"] n_matches
getline raw_hints < hints_path
split(raw_hints, hints, " ")

View File

@ -31,8 +31,10 @@ function show_hints() {
local fingers_pane_id=$1
local compact_hints=$2
FINGERS_ALPHABET_DIR="$CURRENT_DIR/../alphabets/$FINGERS_KEYBOARD_LAYOUT/"
clear_screen "$fingers_pane_id"
get_stdin | FINGERS_COMPACT_HINTS="$compact_hints" gawk -f $CURRENT_DIR/hinter.awk 3> $match_lookup_table
get_stdin | FINGERS_COMPACT_HINTS="$compact_hints" FINGERS_ALPHABET_DIR="$FINGERS_ALPHABET_DIR" gawk -f $CURRENT_DIR/hinter.awk 3> $match_lookup_table
}
function show_hints_and_swap() {