imprv: search enable/disable, some keys, comments

This commit is contained in:
2025-09-03 17:35:55 +02:00
parent 1883109616
commit b15848887b
2 changed files with 36 additions and 13 deletions

View File

@@ -1,3 +1,25 @@
# Key bindings
#
# Some key-bindings are used exclusively in the normal mode, others exclusively
# in the insert mode, others in both modes.
# Some key-bindings are universal in the sense that they do not depend on the
# state of the player (view, mode, arguments), others are not universal.
#
# For fast processing, we propose the following.
# The mode (normal or insert) is stored in the FZF_INPUT_STATE variable. All
# key-bindings that are independent of the `view` and of the `arguments` are
# directly processed using a `--bind` with inline transform element. Keys that
# depend on `view` or `arguments` are processed through `$0 --fzf-key`. In a
# future step, we may also store the `view` part of the state as hidden fields
# in the list (the list generator makes that). Then, it may be possible to
# completely get rid of the state files. Even beter, we may store the view part
# in FZF_HEADER_LABEL.
#
# Switching between the modes (normal <-> insert) is done using two fzf `--bind`
# arguments. We make sure that only one is active.
KEYS_I_NORMAL="${KEYS_I_NORMAL:-"esc"}"
KEYS_N_INSERT="${KEYS_N_INSERT:-"a,i,/"}"
KEYS_INPUT_SINGLE='0,1,2,3,4,5,6,7,8,9,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,!,",#,$,%,&,\,(,),*,+,,,-,.,/,:,;,<,=,>,?,@,[,\,\,],^,_,`,{,|,},~'
KEYS_INPUT_SINGLE="$KEYS_INPUT_SINGLE,'"
KEYS_INPUT_SPECIAL="space,backspace,delete,left,right"
@@ -21,6 +43,8 @@ KEYS_SWITCH_LOCAL_REMOTE="${KEYS_SWITCH_LOCAL_REMOTE:-"ctrl-/"}"
KEYS_PLAY="${KEYS_PLAY:-"enter"}"
KEYS_QUEUE="${KEYS_QUEUE:-"ctrl-alt-m"}"
KEYS_SHOW_PLAYLIST="${KEYS_SHOW_PLAYLIST:-"ctrl-p"}"
KEYS_NI="$KEYS_HALFPAGE_DOWN,$KEYS_HALFPAGE_UP,$KEYS_BROWSE,$KEYS_OPEN,$KEYS_OUT,$KEYS_IN,$KEYS_SELECT_ARTIST,$KEYS_FILTER_LOCAL,$KEYS_FILTER_1,$KEYS_FILTER_2,$KEYS_FILTER_3,$KEYS_FILTER_4,$KEYS_SWITCH_ARTIST_ALBUM,$KEYS_SWITCH_LOCAL_REMOTE,$KEYS_PLAY,$KEYS_QUEUE,$KEYS_SHOW_PLAYLIST"
export KEYS_NI
# Keys in normal mode only
KEYS_N_DOWN="${KEYS_N_DOWN:-"j"}"
@@ -36,23 +60,21 @@ KEYS_N_PLAY_NEXT="${KEYS_N_PLAY_NEXT:-"right"}"
KEYS_N_PLAY_PREV="${KEYS_N_PLAY_PREV:-"left"}"
KEYS_N_SEEK_FORWARD="${KEYS_N_SEEK_FORWARD:-"shift-right"}"
KEYS_N_SEEK_BACKWARD="${KEYS_N_SEEK_BACKWARD:-"shift-left"}"
# Special playlist keys
KEYS_PLAYLIST_RELOAD="${KEYS_PLAYLIST_RELOAD:-"r"}"
KEYS_N="$KEYS_N_DOWN,$KEYS_N_UP,$KEYS_N_OUT,$KEYS_N_IN,$KEYS_N_TOP,$KEYS_N_BOT,$KEYS_N_QUIT,$KEYS_N_INSERT,$KEYS_N_TOGGLE_PLAY_PAUSE,$KEYS_N_PLAY_NEXT,$KEYS_N_PLAY_PREV,$KEYS_N_SEEK_FORWARD,$KEYS_N_SEEK_BACKWARD"
export KEYS_N
# Keys in insert mode only
KEYS_I_NORMAL="${KEYS_I_NORMAL:-"esc"}"
KEYS_I="$KEYS_I_NORMAL"
export KEYS_I
# Special playlist keys
KEYS_PLAYLIST_RELOAD="${KEYS_PLAYLIST_RELOAD:-"r"}"
KEYS_PLAYLIST="$KEYS_PLAYLIST_RELOAD"
export KEYS_PLAYLIST
# Grouping
KEYS_GROUP_NI="$KEYS_HALFPAGE_DOWN,$KEYS_HALFPAGE_UP,$KEYS_OPEN,$KEYS_BROWSE,$KEYS_OUT,$KEYS_IN,$KEYS_SELECT_ARTIST,$KEYS_FILTER_LOCAL,$KEYS_FILTER_1,$KEYS_FILTER_2,$KEYS_FILTER_3,$KEYS_FILTER_4,$KEYS_SWITCH_ARTIST_ALBUM,$KEYS_SWITCH_LOCAL_REMOTE,$KEYS_PLAY,$KEYS_QUEUE,$KEYS_SHOW_PLAYLIST"
KEYS_GROUP_N="$KEYS_N_DOWN,$KEYS_N_UP,$KEYS_N_OUT,$KEYS_N_IN,$KEYS_N_TOP,$KEYS_N_BOT,$KEYS_N_QUIT,$KEYS_N_INSERT,$KEYS_N_TOGGLE_PLAY_PAUSE,$KEYS_N_PLAY_NEXT,$KEYS_N_PLAY_PREV,$KEYS_N_SEEK_FORWARD,$KEYS_N_SEEK_BACKWARD"
KEYS_GROUP_I="$KEYS_I_NORMAL"
KEYS_PLAYLIST="$KEYS_PLAYLIST_RELOAD"
KEYS_ALL="$KEYS_GROUP_NI,$KEYS_GROUP_N,$KEYS_GROUP_I,$KEYS_INPUT_SINGLE,$KEYS_INPUT_SPECIAL,$KEYS_PLAYLIST"
KEYS_ALL="$KEYS_NI,$KEYS_N,$KEYS_I,$KEYS_INPUT_SINGLE,$KEYS_INPUT_SPECIAL,$KEYS_PLAYLIST"
export KEYS_HALFPAGE_DOWN KEYS_HALFPAGE_UP KEYS_OPEN KEYS_BROWSE KEYS_OUT KEYS_IN \
KEYS_SELECT_ARTIST KEYS_FILTER_LOCAL KEYS_FILTER_1 KEYS_FILTER_2 KEYS_FILETER_3 KEYS_FILTER_4 \