diff --git a/functions/vim.zsh b/functions/vim.zsh index 34a30c7..c304098 100644 --- a/functions/vim.zsh +++ b/functions/vim.zsh @@ -6,5 +6,13 @@ vimscratch() { if [ ! -t 0 ] ; then stdin_arg="-" fi - vim -c "set buftype=nofile" $@ $stdin_arg + set +x + if [[ -n "$1" ]]; then + filetype=$1 + shift + vim -c "set buftype=nofile" -c "set filetype=$filetype" $@ $stdin_arg + else + vim -c "set buftype=nofile" $filetype_arg $@ $stdin_arg + fi + }