Last active
August 29, 2015 14:02
-
-
Save alfredodeza/88ea216f2cd57797b737 to your computer and use it in GitHub Desktop.
Run a Vim command on a bunch of files
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
# For a bunch of Python files | |
vim -c "bufdo! set eventignore-=Syntax| %s/original/replacement/gce" *.py | |
# if you want to save as you go | |
vim -c "bufdo! set eventignore-=Syntax| %s/original/replacement/gce | update" *.py | |
# Breaking it down: | |
# bufdo! -> so that it doesn't complain about erroring | |
# set eventignore-=Syntax -> so that every buffer gets syntax highlighting | |
# /gce -> optional, global search in the line with confirmation and eating up the errors | |
# | update -> optional update to save every buffer as you move |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment