1 changed files with 5 additions and 3 deletions
@ -1,10 +1,12 @@
@@ -1,10 +1,12 @@
|
||||
#!/bin/bash |
||||
|
||||
# (c) https://stackoverflow.com/questions/10686183/pipe-vim-buffer-to-stdout/10686830#10686830 |
||||
|
||||
TMPFILE=$(mktemp /tmp/viper.XXXXXXXX) |
||||
cat > "$TMPFILE" |
||||
$EDITOR "$@" "$TMPFILE" < /dev/tty > /dev/tty |
||||
|
||||
if [ "$?" -eq 0 ]; then |
||||
cat "$TMPFILE" |
||||
fi |
||||
|
||||
\rm -f "$TMPFILE" |
||||
|
||||
|
Loading…
Reference in new issue