Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Features:

- [reference-finder] Goto type: goto the type of the symbol under the cursor #892 - @dantleech

Documentation:

- [doc] Fix examples in refactoring documentation - @Great-Antique
- [doc] Fix example mappings and add missing commands - @yeagassy

## 2020-03-04 0.14.1

Bug fixes:
Expand Down
32 changes: 25 additions & 7 deletions doc/phpactor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ COMMANDS *phpactor-commands*
:PhpactorGenerateAccessors *:PhpactorGenerateAccessors*
Generate accessors for the current class

:PhpactorTransform *:PhpactorTransform*
Automatically add any missing properties to a class

==============================================================================
MAPPINGS *phpactor-mappings*

Expand All @@ -194,22 +197,37 @@ are available for you to copy:
augroup PhpactorMappings
au!
au FileType php nmap <buffer> <Leader>u :PhpactorImportClass<CR>
au FileType php nmap <buffer> <Leader>e :PhpactorClassExpand<CR>
au FileType php nmap <buffer> <Leader>ua :PhpactorImportMissingClasses<CR>
au FileType php nmap <buffer> <Leader>mm :PhpactorContextMenu<CR>
au FileType php nmap <buffer> <Leader>nn :PhpactorNavigate<CR>
au FileType php nmap <buffer> <Leader>oo :PhpactorGotoDefinition<CR>
au FileType php nmap <buffer> <Leader>oh :PhpactorGotoDefinitionHsplit<CR>
au FileType php nmap <buffer> <Leader>ov :PhpactorGotoDefinitionVsplit<CR>
au FileType php nmap <buffer> <Leader>ot :PhpactorGotoDefinitionTab<CR>
au FileType php,cucumber nmap <buffer> <Leader>o
\ :PhpactorGotoDefinition<CR>
au FileType php,cucumber nmap <buffer> <Leader>Oh
\ :PhpactorGotoDefinitionHsplit<CR>
au FileType php,cucumber nmap <buffer> <Leader>Ov
\ :PhpactorGotoDefinitionVsplit<CR>
au FileType php,cucumber nmap <buffer> <Leader>Ot
\ :PhpactorGotoDefinitionTab<CR>
au FileType php nmap <buffer> <Leader>K :PhpactorHover<CR>
au FileType php nmap <buffer> <Leader>tt :PhpactorTransform<CR>
au FileType php nmap <buffer> <Leader>cc :PhpactorClassNew<CR>
au FileType php nmap <buffer> <silent> <Leader>ee :PhpactorExtractExpression<CR>
au FileType php vmap <buffer> <silent> <Leader>ee :<C-u>PhpactorExtractExpression<CR>
au FileType php vmap <buffer> <silent> <Leader>em :<C-u>PhpactorExtractMethod<CR>
au FileType php nmap <buffer> <Leader>ci :PhpactorClassInflect<CR>
au FileType php nmap <buffer> <Leader>fr :PhpactorFindReferences<CR>
au FileType php nmap <buffer> <Leader>mf :PhpactorMoveFile<CR>
au FileType php nmap <buffer> <Leader>cf :PhpactorCopyFile<CR>
au FileType php nmap <buffer> <silent> <Leader>ee
\ :PhpactorExtractExpression<CR>
au FileType php vmap <buffer> <silent> <Leader>ee
\ :<C-u>PhpactorExtractExpression<CR>
au FileType php vmap <buffer> <silent> <Leader>em
\ :<C-u>PhpactorExtractMethod<CR>
augroup END
<

Note: the cucumber mappings are for the Behat extension:

https://github.com/phpactor/behat-extension


vim:tw=78:ts=8:ft=help:norl:
29 changes: 22 additions & 7 deletions ftplugin/php/mappings.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,34 @@
" augroup PhpactorMappings
" au!
" au FileType php nmap <buffer> <Leader>u :PhpactorImportClass<CR>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not even sure this will works.
This file ftplugin/php/mappings.vim will only be loaded for files with the php filetype.
So the FileType event might already have been triggered and the auto commands won't do a thing...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm .. this is just documentation not a vimscript?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I feel like someone reading it might try put this in a file with the same name and path.
Since it's already somewhere else in the doc, either delete this duplicate or fix it if it's indeed broken.

@dantleech dantleech Mar 14, 2020 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "already somewhere else"? - it shouldn't be anywhere else other than doc/phpactor.txt which is generated from this file.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that in :help phpactor the path of this file is not visible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I wasn't aware of that... * shame *
Just ignore all that :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" au FileType php nmap <buffer> <Leader>e :PhpactorClassExpand<CR>
" au FileType php nmap <buffer> <Leader>ua :PhpactorImportMissingClasses<CR>
" au FileType php nmap <buffer> <Leader>mm :PhpactorContextMenu<CR>
" au FileType php nmap <buffer> <Leader>nn :PhpactorNavigate<CR>
" au FileType php nmap <buffer> <Leader>oo :PhpactorGotoDefinition<CR>
" au FileType php nmap <buffer> <Leader>oh :PhpactorGotoDefinitionHsplit<CR>
" au FileType php nmap <buffer> <Leader>ov :PhpactorGotoDefinitionVsplit<CR>
" au FileType php nmap <buffer> <Leader>ot :PhpactorGotoDefinitionTab<CR>
" au FileType php,cucumber nmap <buffer> <Leader>o
" \ :PhpactorGotoDefinition<CR>
" au FileType php,cucumber nmap <buffer> <Leader>Oh
" \ :PhpactorGotoDefinitionHsplit<CR>
" au FileType php,cucumber nmap <buffer> <Leader>Ov
" \ :PhpactorGotoDefinitionVsplit<CR>
" au FileType php,cucumber nmap <buffer> <Leader>Ot
" \ :PhpactorGotoDefinitionTab<CR>
" au FileType php nmap <buffer> <Leader>K :PhpactorHover<CR>
" au FileType php nmap <buffer> <Leader>tt :PhpactorTransform<CR>
" au FileType php nmap <buffer> <Leader>cc :PhpactorClassNew<CR>
" au FileType php nmap <buffer> <silent> <Leader>ee :PhpactorExtractExpression<CR>
" au FileType php vmap <buffer> <silent> <Leader>ee :<C-u>PhpactorExtractExpression<CR>
" au FileType php vmap <buffer> <silent> <Leader>em :<C-u>PhpactorExtractMethod<CR>
" au FileType php nmap <buffer> <Leader>ci :PhpactorClassInflect<CR>
" au FileType php nmap <buffer> <Leader>fr :PhpactorFindReferences<CR>
" au FileType php nmap <buffer> <Leader>mf :PhpactorMoveFile<CR>
" au FileType php nmap <buffer> <Leader>cf :PhpactorCopyFile<CR>
" au FileType php nmap <buffer> <silent> <Leader>ee
" \ :PhpactorExtractExpression<CR>
" au FileType php vmap <buffer> <silent> <Leader>ee
" \ :<C-u>PhpactorExtractExpression<CR>
" au FileType php vmap <buffer> <silent> <Leader>em
" \ :<C-u>PhpactorExtractMethod<CR>
" augroup END
" <
"
" Note: the cucumber mappings are for the Behat extension:
"
" https://github.com/phpactor/behat-extension