Skip to content

Commit bd3f145

Browse files
authored
Merge pull request #7 from phux/instant-extract-method
Instantly extract method
2 parents 644abbf + 13c4da4 commit bd3f145

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ method the press `<Leader>rem`
3131

3232
You will be prompted for the name of the new method.
3333

34+
If you want to bypass the menu:
35+
36+
vnoremap <leader>em :call PhpRefactorExtractMethodDirectly()<cr>
37+
3438
### RENAME LOCAL VARIABLE
3539
In normal mode move the cursor so it's inside the name of the variable
3640
which you want to rename. Press `<Leader>rlv`

plugin/phprefactor.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ func! PhpRefactorExtractMethod(startline, endline)
4949
" todo : exit visual mode
5050
endfunc
5151

52+
func! PhpRefactorExtractMethodDirectly() range
53+
call PhpRefactorExtractMethod(a:firstline, a:lastline)
54+
endfunc
55+
5256
func! PhpRefactorLocalVariableToInstanceVariable()
5357
" check the file has been saved
5458
if &modified

0 commit comments

Comments
 (0)