Skip to content

Instantly share code, notes, and snippets.

@dvtalk
Last active August 15, 2020 04:38
Show Gist options
  • Select an option

  • Save dvtalk/cd26d6ed3033e43968eef1586afc9a60 to your computer and use it in GitHub Desktop.

Select an option

Save dvtalk/cd26d6ed3033e43968eef1586afc9a60 to your computer and use it in GitHub Desktop.
Use when inside vim terminal, zsh function to send file from vim terminal to open in current vim.
function vimsend() {
local path=""
if [ -e ./$1 ]; then
path="$PWD/${1}"
echo "$path"
elif [ -e $1 ]; then
path=$1
echo "$path"
else
echo "Oops, file not found yo!! $1"
fi
printf "^[]51;[\"drop\", \"$path\"]^G"
}
@dvtalk
Copy link
Author

dvtalk commented Mar 14, 2020

^[ is created by hitting <Ctrl-v> then <ESC>
^G is created by hitting <Ctrl-v> then <Ctrl-g>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment