]> git.rmz.io Git - dotfiles.git/blobdiff - aliases
alias: return error when no arguments given to vim within VIM_TERMINAL
[dotfiles.git] / aliases
diff --git a/aliases b/aliases
index f09cea4fd362215196152cf5cc46057d64e0caab..7163ca4078b2ea18690ae718b4d38af057acd82a 100644 (file)
--- a/aliases
+++ b/aliases
@@ -15,6 +15,10 @@ alias free='free -m'             # show sizes in MB
 
 if [[ -n "${VIM_TERMINAL}" ]]; then
     function vim() {
+        if (( ${#@} == 0 )); then
+            echo "Running in Vim's terminal, at least one file must be given!" >&2
+            return 22
+        fi
         for f in "$@"; do
             if [[ "${f:0:1}" == "-" ]]; then
                 echo "Running in Vim's terminal, not accepting options!" >&2