Last active
February 11, 2017 09:08
-
-
Save mihow/94907cf05b0f20219f78abe4b3a975b6 to your computer and use it in GitHub Desktop.
Refactor from functions to class functions by adding `self` to all function arguments (VIM search and replace command)
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 functions with existing arguments | |
:%s/def \(.\+\)(\(.\+\)):/def \1(self, \2):/ | |
# For functions with no arguments | |
:%s/def \(.\+\)():/def \1(self):/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment