vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit a65e9502f2c4144a108540fe35aa39750248d27f parent a5b7d767aa5da82600950e975ff65e1e45430e73 Author: Vadym Kochan <vadim4j@gmail.com> Date: Wed, 16 Dec 2020 00:37:48 +0200 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:
| M | vis-open | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git 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"