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 local args
# if running in a pipe, use stdin (-) as arg. # if running in a pipe, use stdin (-) as arg.
# -t checks if the given FD is a terminal # -t checks if the given FD is a terminal
if [ -t 0 ] ; then if [ ! -t 0 ] ; then
args="$@" stdin_arg="-"
else
args="-"
fi fi
vim -c "set buftype=nofile" "$args" vim -c "set buftype=nofile" $@ $stdin_arg
} }