X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/c5b6f313409f35ecdacb022ef2cff688a529249b..24e3ac6deff61a37dfcb46eb662c59fa5215a501:/aliases diff --git a/aliases b/aliases index 57dbfb8..7163ca4 100644 --- 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 @@ -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 - echo -e "]51;[\"drop\", \"$f\"]" + local abspath=$(realpath $f) + echo -e "]51;[\"drop\", \"$abspath\"]" done } fi