1
0
Fork 0
vim/runtime/macros/less.sh
Daniel Baumann 0985b09abd
Adding upstream version 2:9.1.1230.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-21 11:09:31 +02:00

26 lines
588 B
Bash
Executable file

#!/bin/sh
# Shell script to start Vim with less.vim.
# Read stdin if no arguments were given and stdin was redirected.
if test -t 1; then
if test $# = 0; then
if test -t 0; then
echo "Missing filename" 1>&2
exit
fi
vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' -
else
vim --cmd 'let no_plugin_maps = 1' -c 'runtime! macros/less.vim' "$@"
fi
else
# Output is not a terminal, cat arguments or stdin
if test $# = 0; then
if test -t 0; then
echo "Missing filename" 1>&2
exit
fi
cat
else
cat "$@"
fi
fi