1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-23 12:01:30 +01:00
dotfiles/functions/vim.zsh

Failed to ignore revisions in .git-blame-ignore-revs.

13 lines
306 B
Bash
Raw Normal View History

# open vim with a scratch window that can be discarded on exit.
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="-"
fi
vim -c "set buftype=nofile" "$args"
}