Permalink
Browse files

Escape / and & to make vim's regexes more like Perl's

  • Loading branch information...
1 parent cde7dc1 commit 82a96891b16c38b77401f4556a9904e6d2455526 @tsibley committed Jan 4, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 viack
View
@@ -6,7 +6,7 @@ for arg; do
# Try to make vim's magic mode more like Perl's standard regexes
# Magic chars gleaned from :help magic, and the most common problem
# characters are < and >
- pattern=$(echo -n "$arg" | perl -pe 's/([<>=@!%])/\\$1/g')
+ pattern=$(echo -n "$arg" | perl -pe 's{([<>=@!%/&])}{\\$1}g')
opts="+0 +/\\v$pattern"
break
elif [[ "$arg" == "--" ]]; then

0 comments on commit 82a9689

Please sign in to comment.