Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added $ZSHSELECT_INSTANT_SELECT configurationoption. #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export ZSHSELECT_COLOR_PAIR="white/black" # Draw in white foreground, black ba
export ZSHSELECT_BORDER="0" # No border around interface, Use "1" for the border
export ZSHSELECT_ACTIVE_TEXT="reverse" # Mark current element with reversed text. Use "underline" for marking with underline
export ZSHSELECT_START_IN_SEARCH_MODE="1" # Starts Zsh-Select with searching active. "0" will not invoke searching at start.
export ZSHSELECT_INSTANT_SELECT="1" # If 1, pressing enter when in search mode will not only leave the mode, but also do selection and leave tool.
```

## Use with plugin managers
Expand Down
2 changes: 2 additions & 0 deletions functions/zsh-select
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# - ZSHSELECT_BORDER
# - ZSHSELECT_ACTIVE_TEXT
# - ZSHSELECT_START_IN_SEARCH_MODE
# - ZSHSELECT_INSTANT_SELECT

builtin emulate -RL zsh ${=${options[xtrace]:#off}:+-o xtrace}
builtin setopt extended_glob warn_create_global typeset_silent no_short_loops rc_quotes no_auto_pushd
Expand All @@ -34,6 +35,7 @@ themes=( "white/black/0" "white/black/1" "green/black/0" "green/black/1" "white/
# If 1, pressing enter when in search mode will not only
# leave the mode, but also do selection and leave tool
local NLIST_INSTANT_SELECT=0
[[ "$ZSHSELECT_INSTANT_SELECT" = (0|1) ]] && NLIST_INSTANT_SELECT="$ZSHSELECT_INSTANT_SELECT"

# How should be current element of the list drawn. Possible values: reverse, underline.
# On Linux virtual terminal this will be enforced to reverse (because of poor
Expand Down