Last active
August 15, 2020 04:38
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
^[is created by hitting<Ctrl-v>then<ESC>^Gis created by hitting<Ctrl-v>then<Ctrl-g>