Last active
December 17, 2015 18:39
-
-
Save mapix/5655003 to your computer and use it in GitHub Desktop.
svn&git repo autocomplete file in 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 is_git_repository { | |
| git branch > /dev/null 2>&1 | |
| } | |
| function is_svn_repository { | |
| test -d .svn | |
| } | |
| if is_git_repository ; then | |
| git ls-files | dmenu -i -l 20 -p $1 | |
| elif is_svn_repository ; then | |
| find . -iwholename "*$1*" -type f -not \( -name '*pyc' -o -name '*py~' -o -name '*.swp' -o -name '*un~' \) -not -iwholename '*.svn*' -not -iwholename '*.git*'| dmenu -i -l 20 -p $1 | |
| fi |
Author
mapix
commented
May 27, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment