diff --git a/README.md b/README.md index baa9b25..ce1b174 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ will create the symbolic link for each script in the \ directory. - [fsz](fsz) adjusts console font size. - [hr](hr) displays horizontal rule with current time. - [vcat](vcat) displays file content with [syntax highlighting](https://www.gnu.org/software/src-highlite/) (see also [bat](https://github.com/sharkdp/bat)). +- [viper](viper) is a simple alternative to viper from [moreutils](https://joeyh.name/code/moreutils/) package which can be used with custom vim parameters. ## Audio diff --git a/viper b/viper new file mode 100755 index 0000000..3333a3f --- /dev/null +++ b/viper @@ -0,0 +1,10 @@ +#!/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 +cat "$TMPFILE" +\rm -f "$TMPFILE" +