]> git.rmz.io Git - dotfiles.git/blobdiff - aliases
vim: highlight non-breakable-spaces
[dotfiles.git] / aliases
diff --git a/aliases b/aliases
index 57dbfb8fe74e79afb909419b010f55bfec049819..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 [[ -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
         for f in "$@"; do
             if [[ "${f:0:1}" == "-" ]]; then
                 echo "Running in Vim's terminal, not accepting options!" >&2
@@ -24,7 +28,8 @@ if [[ -n "${VIM_TERMINAL}" ]]; then
         for f in "$@"; do
             # drop the file onto the running vim instance
             # see :h terminal-communication
         for f in "$@"; do
             # drop the file onto the running vim instance
             # see :h terminal-communication
-            echo -e "\e]51;[\"drop\", \"$f\"]\a"
+            local abspath=$(realpath $f)
+            echo -e "\e]51;[\"drop\", \"$abspath\"]\a"
         done
     }
 fi
         done
     }
 fi