Compare commits

...

2 Commits

Author SHA1 Message Date
bretello ee531d18cd functions: remove debug statements in vimscratch 2023-09-25 12:56:09 +02:00
bretello 125a4e7aed functions: allow arguments in vimscratch 2023-09-25 12:39:24 +02:00
1 changed files with 3 additions and 5 deletions

View File

@ -3,10 +3,8 @@ vimscratch() {
local args
# if running in a pipe, use stdin (-) as arg.
# -t checks if the given FD is a terminal
if [ -t 0 ] ; then
args="$@"
else
args="-"
if [ ! -t 0 ] ; then
stdin_arg="-"
fi
vim -c "set buftype=nofile" "$args"
vim -c "set buftype=nofile" $@ $stdin_arg
}