diff --git a/README.md b/README.md index f61c428..354a6e7 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,10 @@ method the press `rem` You will be prompted for the name of the new method. +If you want to bypass the menu: + + vnoremap em :call PhpRefactorExtractMethodDirectly() + ### RENAME LOCAL VARIABLE In normal mode move the cursor so it's inside the name of the variable which you want to rename. Press `rlv` diff --git a/plugin/phprefactor.vim b/plugin/phprefactor.vim index e8152ea..edf07f1 100644 --- a/plugin/phprefactor.vim +++ b/plugin/phprefactor.vim @@ -49,6 +49,10 @@ func! PhpRefactorExtractMethod(startline, endline) " todo : exit visual mode endfunc +func! PhpRefactorExtractMethodDirectly() range + call PhpRefactorExtractMethod(a:firstline, a:lastline) +endfunc + func! PhpRefactorLocalVariableToInstanceVariable() " check the file has been saved if &modified