keybinding help in all views
This commit is contained in:
26
src/main.sh
26
src/main.sh
@@ -274,7 +274,7 @@ case "${1:-}" in
|
||||
[ "$q" ] && q="$q "
|
||||
printf "show-input+change-query(%s)" "$q"
|
||||
# Store current state
|
||||
printf "+change-border-label(%s)+change-list-label(%s)" "$view" "$mbid"
|
||||
printf "+change-list-label(%s)" "$view"
|
||||
# Set header
|
||||
fzf_command_set_header "$view" "$mbid"
|
||||
# Set preview window
|
||||
@@ -486,17 +486,17 @@ mpv_start
|
||||
# mode, we call `hide-input`. To switch to insert mode, we call `show-input`.
|
||||
#
|
||||
# view: [$VIEW_*]
|
||||
# The view is stored in $FZF_BORDER_LABEL. To set the view, call
|
||||
# `change-border-label($VIEW)`.
|
||||
# The view is stored in $FZF_LIST_LABEL. To set the view, call
|
||||
# `change-list-label($VIEW)`.
|
||||
#
|
||||
# argument: string
|
||||
# The argument is stored in $FZF_LIST_LABEL. To set the argument, call
|
||||
# `change-list-label($arg)`.
|
||||
IN_NORMAL_MODE="[ \$FZF_INPUT_STATE = hidden ]"
|
||||
IN_VIEW_PATTERN="[ \$FZF_BORDER_LABEL = %s ]"
|
||||
IN_VIEW_PATTERN="[ \$FZF_LIST_LABEL = %s ]"
|
||||
IN_LIST_ARTISTS_VIEW="$(printf "$IN_VIEW_PATTERN" "$VIEW_LIST_ARTISTS")"
|
||||
FZF_CURRENT_MODE="\$FZF_INPUT_STATE"
|
||||
FZF_CURRENT_VIEW="\$FZF_BORDER_LABEL"
|
||||
FZF_CURRENT_VIEW="\$FZF_LIST_LABEL"
|
||||
FZF_RELOAD_PLAYLIST="reload-sync($0 --lines $VIEW_PLAYLIST)"
|
||||
FZF_POS_PLAYLIST="transform:$0 --action-playlistcursor"
|
||||
PUT_FZF_KEY_LOGIC="case \$FZF_KEY in space) echo \"put( )\";; left) echo backward-char;; right) echo forward-char;; backspace|bspace|bs) echo backward-delete-char;; delete|del) echo delete-char;; *) echo \"put(\$FZF_KEY)\";; esac"
|
||||
@@ -517,6 +517,11 @@ while true; do
|
||||
--bind="$KEYS_SEARCH_ALBUM:print($VIEW_SEARCH_ALBUM)+accept" \
|
||||
--bind="$KEYS_BROWSE:execute-silent:open \"https://musicbrainz.org/artist/{r3}\"" \
|
||||
--bind="$KEYS_SHOW_PLAYLIST:print($VIEW_PLAYLIST)+print()+accept" \
|
||||
--bind="$KEYS_KEYBINDINGS:preview:$0 --show-keybindings $VIEW_SELECT_ARTIST" \
|
||||
--bind="$KEYS_SCROLL_PREVIEW_DOWN:preview-down" \
|
||||
--bind="$KEYS_SCROLL_PREVIEW_UP:preview-up" \
|
||||
--bind="$KEYS_PREVIEW_OPEN:show-preview" \
|
||||
--bind="$KEYS_PREVIEW_CLOSE:hide-preview" \
|
||||
-0 -1 \
|
||||
--border="bold" \
|
||||
--border-label="Select artist" \
|
||||
@@ -561,6 +566,12 @@ while true; do
|
||||
--bind="$KEYS_SEARCH_ALBUM:print($VIEW_SEARCH_ALBUM)+accept" \
|
||||
--bind="$KEYS_BROWSE:execute-silent:open \"https://musicbrainz.org/\track/{r3}\"" \
|
||||
--bind="$KEYS_OPEN:execute-silent:open \"\$(dirname {4})\"" \
|
||||
--bind="$KEYS_N_YANK:execute-silent:printf {3} | $CLIP)" \
|
||||
--bind="$KEYS_YANK_CURRENT:execute-silent:printf {2} | $CLIP" \
|
||||
--bind="$KEYS_KEYBINDINGS:preview:$0 --show-keybindings $VIEW_PLAYLIST" \
|
||||
--bind="$KEYS_SCROLL_PREVIEW_DOWN:preview-down" \
|
||||
--bind="$KEYS_SCROLL_PREVIEW_UP:preview-up" \
|
||||
--bind="$KEYS_PREVIEW_CLOSE:hide-preview" \
|
||||
--bind="$KEYS_PLAYBACK,$KEYS_N_PLAYBACK:transform($0 --playback $VIEW_PLAYLIST {2} {3} {4})+$FZF_RELOAD_PLAYLIST+$FZF_POS_PLAYLIST" \
|
||||
--bind="$KEYS_PLAYLIST_RELOAD:$FZF_RELOAD_PLAYLIST+$FZF_POS_PLAYLIST" \
|
||||
--bind="$KEYS_PLAYLIST_REMOVE:execute-silent($0 --playlist $PLAYLIST_CMD_REMOVE)+$FZF_RELOAD_PLAYLIST" \
|
||||
@@ -598,7 +609,7 @@ while true; do
|
||||
# `$PUT_FZF_KEY_LOGIC` for details.
|
||||
#
|
||||
# Here is a list of all keys grouped by type (see `src/sh/keys.sh`).
|
||||
#--bind="start:change-border-label($VIEW)+change-list-label($MBID)+$MODE-input+transform:$0 --display" \
|
||||
#--bind="start:change-list-label($VIEW)+change-list-label($MBID)+$MODE-input+transform:$0 --display" \
|
||||
sel=$(
|
||||
printf "" | $FZF \
|
||||
--reverse \
|
||||
@@ -640,7 +651,7 @@ esac" \
|
||||
--bind="$KEYS_FILTER:transform:$0 --action-filter $FZF_CURRENT_MODE $FZF_CURRENT_VIEW" \
|
||||
--bind="$KEYS_BROWSE:execute-silent:
|
||||
[ {3} ] || exit 0
|
||||
case \$FZF_BORDER_LABEL in
|
||||
case $FZF_CURRENT_VIEW in
|
||||
$VIEW_LIST_ARTISTS | $VIEW_SEARCH_ARTIST) t=artist ;;
|
||||
$VIEW_ARTIST | $VIEW_SEARCH_ALBUM | $VIEW_LIST_ALBUMS) t=release-group ;;
|
||||
$VIEW_RELEASEGROUP) t=release ;;
|
||||
@@ -662,6 +673,7 @@ open \"\$(dirname {4})\"" \
|
||||
--bind="$KEYS_PREVIEW_CLOSE:hide-preview" \
|
||||
--bind="$KEYS_PLAYBACK:transform:$0 --playback $FZF_CURRENT_VIEW {2} {3} {4}" \
|
||||
--bind="$KEYS_N_PLAYBACK:transform:$IN_NORMAL_MODE && $0 --playback $FZF_CURRENT_VIEW {2} {3} {4} || $PUT_FZF_KEY_LOGIC" \
|
||||
--bind="W:execute-silent:echo 1 >> /tmp/foo; echo $FZF_CURRENT_VIEW >> /tmp/foo; echo 2 >> /tmp/foo" \
|
||||
--bind="change:execute-silent($0 --mbsearch $FZF_CURRENT_VIEW &)+reload:$0 --lines $FZF_CURRENT_VIEW" \
|
||||
--preview-window="right,25%,border-left,wrap,<30(hidden)" \
|
||||
--preview="$0 --preview $FZF_CURRENT_VIEW {3}" \
|
||||
|
||||
Reference in New Issue
Block a user