Created
December 3, 2016 14:44
-
-
Save srhopkins/77ac14b18a1557a39d1b0aa0decd08a7 to your computer and use it in GitHub Desktop.
govim - relative path aware
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
#!/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