Skip to content

Instantly share code, notes, and snippets.

@victor141516
Last active May 17, 2019 12:03
Show Gist options
  • Save victor141516/90a8013e3cbce3cb23c992bc4a033f88 to your computer and use it in GitHub Desktop.
Save victor141516/90a8013e3cbce3cb23c992bc4a033f88 to your computer and use it in GitHub Desktop.
It mimics sshcode behaviour but using your local VSCode. Creates a vfs using sshfs then opens it using VSCode, then umounts and deletes it at VSCode close event. Add to your .bashrc/.zshrc
function sshlcode {
DIR=.$(echo $1 | sed 's/[@.:\/]/_/g') && \
sshfs $1 $DIR && \
code --new-window --wait $DIR ; \
until umount $DIR; do sleep 0.1; done && \
rmdir $DIR
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment