Skip to content

Instantly share code, notes, and snippets.

@srhopkins
Created December 3, 2016 14:44
Show Gist options
  • Save srhopkins/77ac14b18a1557a39d1b0aa0decd08a7 to your computer and use it in GitHub Desktop.
Save srhopkins/77ac14b18a1557a39d1b0aa0decd08a7 to your computer and use it in GitHub Desktop.
govim - relative path aware
#!/bin/bash
# This allows use of govim container with relative paths
# e.g.
# vim ../this.file
# vim ~/.bashrc
function govim(){
RDIR=`pwd | awk -F/ '{print "/"$2}'`
docker run -it --rm -v ${RDIR}:${RDIR} -w `pwd` srhopkins/govim vim "$@"
}
alias vim='govim "$@"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment