Created
June 8, 2017 08:41
-
-
Save yyq123/e1abcf60f06f92a74995b4c481530f27 to your computer and use it in GitHub Desktop.
This file contains 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 DeAmperfyAll() range"Step through each line in the range... | |
for linenum in range(a:firstline, a:lastline) | |
"Replace loose ampersands (as in DeAmperfy())... | |
let curr_line = getline(linenum) | |
let replacement = substitute(curr_line,'&\(\w\+;\)\@!','&','g') | |
call setline(linenum, replacement) | |
endfor | |
"Report what was done... | |
if a:lastline > a:firstline | |
echo "DeAmperfied" (a:lastline - a:firstline + 1) "lines" | |
endif | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment