Created
December 28, 2013 00:44
-
-
Save tomphp/8154644 to your computer and use it in GitHub Desktop.
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
func! PhpRefactorShowMenu() | |
echohl Title | |
echo 'Available Refactorings:' | |
echohl None | |
echo '(em) Extract Method' | |
echo '(lv) rename Local Variable' | |
echo '(li) Local variable to Instance variable' | |
echo '(ou) Optimize Use' | |
echo '' | |
echo '(c) Cancel' | |
echo '' | |
let choice = nr2char(getchar()) | |
if choice == 'c' | |
return | |
endif | |
let choice = choice . nr2char(getchar()) | |
if choice == 'em' | |
call PhpRefactorExtractMethod() | |
elseif choice == 'lv' | |
call PhpRefactorRenameLocalVariable() | |
elseif choice == 'li' | |
call PhpRefactorLocalVariableToInstanceVariable() | |
elseif choice == 'ou' | |
call PhpRefactorOptimizeUse() | |
endif | |
endfunc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment