aboutsummaryrefslogtreecommitdiff
path: root/vis-open
diff options
context:
space:
mode:
authorVadym Kochan <vadim4j@gmail.com>2020-12-16 00:37:48 +0200
committerRandy Palamar <palamar@ualberta.ca>2023-08-01 09:39:15 -0600
commit32e20a2df0fc5d0f61c8292d3f6241476a356476 (patch)
treee499b9c4201ad1a78c20de8bc79f47d04bfb1233 /vis-open
parent5d7d62c73b258d06efaf5d93026b9e556e4e84d8 (diff)
downloadvis-32e20a2df0fc5d0f61c8292d3f6241476a356476.tar.gz
vis-32e20a2df0fc5d0f61c8292d3f6241476a356476.tar.xz
vis-open: allow to show files vertically
It might be more comfortable to navigate through the files arranged vertically. Add ability to specify VIS_OPEN_LINES environment variable which is passed to vis-menu as -l option. It would be better to add vis option for this to set it via lua config, but it might be added later. Signed-off-by: Vadym Kochan <vadim4j@gmail.com>
Diffstat (limited to 'vis-open')
-rwxr-xr-xvis-open6
1 files changed, 5 insertions, 1 deletions
diff --git a/vis-open b/vis-open
index a79792f..28d1b1a 100755
--- a/vis-open
+++ b/vis-open
@@ -5,6 +5,10 @@ set -e
NL='
'
+if [ -z "$VIS_OPEN_LINES" ]; then
+ VIS_OPEN_LINES='0'
+fi
+
VIS_MENU_PROMPT=''
ALLOW_AUTO_SELECT='1'
@@ -66,7 +70,7 @@ fi
# At this point, we have a bunch of options we need to present to the
# user so they can pick one.
-CHOICE="$(printf '%s\n' '..' "$@" | wrap_dirs | vis-menu -b -p "$VIS_MENU_PROMPT")"
+CHOICE="$(printf '%s\n' '..' "$@" | wrap_dirs | vis-menu -b -l "$VIS_OPEN_LINES" -p "$VIS_MENU_PROMPT")"
# Did they pick a file or directory? Who knows, let's let the next iteration figure it out.
exec "$0" -p "$VIS_MENU_PROMPT" -- "$CHOICE"