Skip to content

Instantly share code, notes, and snippets.

@tomphp
Created December 28, 2013 00:44
Show Gist options
  • Save tomphp/8154644 to your computer and use it in GitHub Desktop.
Save tomphp/8154644 to your computer and use it in GitHub Desktop.
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