mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-11-12 23:01:31 +01:00
13 lines
314 B
Bash
13 lines
314 B
Bash
# open vim with a scratch window that can be discarded on exit.
|
|
vimscratch() {
|
|
set -x
|
|
local args
|
|
# if running in a pipe, use stdin (-) as arg.
|
|
# -t checks if the given FD is a terminal
|
|
if [ ! -t 0 ] ; then
|
|
stdin_arg="-"
|
|
fi
|
|
vim -c "set buftype=nofile" $@ $stdin_arg
|
|
set +x
|
|
}
|