HelpΒΆ

You can view this manual in VIM by typing :help phpactor

*phpactor.txt*
                                                                    *phpactor*

==============================================================================
CONTENTS                                                   *phpactor-contents*
  1. Introduction.............................................|phpactor-intro|
  2. Configuration...........................................|phpactor-config|
  3. Completion..........................................|phpactor-completion|
  4. Commands..............................................|phpactor-commands|
  5. Mappings..............................................|phpactor-mappings|

==============================================================================
INTRODUCTION                                                  *phpactor-intro*


Phpactor is a auto-completion, refactoring and code-navigation tool for PHP.
This is the help file for the VIM client. For more information see the
official website: https://phpactor.github.io/phpactor/

NOTE: This help is auto-generated from the VimScript using
https://github.com/google/vimdoc. See
https://phpactor.github.io/phpactor/developing.html#vim-help

==============================================================================
CONFIGURATION                                                *phpactor-config*

                                                            *g:phpactorPhpBin*
Path to the PHP binary used by Phpactor

                                                            *g:phpactorBranch*
The Phpactor branch to use when calling |:PhpactorUpdate|

                                               *g:phpactorOmniAutoClassImport*
Automatically import classes when using VIM native omni-completion

                                              *g:phpactorCompletionIgnoreCase*
Ignore case when suggestion completion results

                                                  *g:phpactorQuickfixStrategy*
Function to use when populating a list of code references. The default is to
use the VIM quick-fix list.

                                                 *g:phpactorInputListStrategy*
Function to use when presenting a user with a choice of options. The default
is to use the VIM inputlist.

                                                    *g:phpactorUseOpenWindows*
When jumping to a file location: if the target file open in a window, switch
to that window instead of switching buffers.  The default is false.

                                             *g:PhpactorRootDirectoryStrategy*
Each Phpactor request requires the project's root directory to be known. By
default it will assume the directory in which you started VIM, but this may
not suit all workflows.

This setting allows |Funcref| to be specified. This function should return the
working directory in whichever way is required. No arguments are passed to
this function.

==============================================================================
COMPLETION                                               *phpactor-completion*


You will need to explcitly configure Phpactor to provide completion
capabilities.

OMNI-COMPLETION

Use VIMs native omni-completion (|compl-omni|)

Enbale omni-completion for PHP files:
>

  autocmd FileType php setlocal omnifunc=phpactor#Complete

<
For case sensitive searching see |g:phpactorCompletionIgnoreCase|

NCM2

Nvim Completion Manager is a completion manager for Neovim.

Install the integration plugin to get started:
https://github.com/phpactor/ncm2-phpactor

DEOPLETE

Deoplete is another completion plugin.

Install the Deoplete Phpactor integration to get started:
https://github.com/kristijanhusak/deoplete-phpactor

==============================================================================
COMMANDS                                                   *phpactor-commands*

:[range][N]PhpactorExtractMethod                      *:PhpactorExtractMethod*
  Extract a new method from the current selection

:[range][N]PhpactorExtractExpression              *:PhpactorExtractExpression*
  Extract the selected expression and assign it to a variable before (placing
  it before the current statement)

:[N]PhpactorExtractConstant                         *:PhpactorExtractConstant*
  Extract a constant from a literal

:[N]PhpactorImportClass                                 *:PhpactorImportClass*
  Import the name under the cusor. If multiple options are available, you are
  able to choose one.

:[N]PhpactorImportMissingClasses               *:PhpactorImportMissingClasses*
  Attempt to import all non-resolvable classes in the current class (based on
  offset position)

:[N]PhpactorHover                                             *:PhpactorHover*
  Show information about the symbol under the cursor.

:[N]PhpactorContextMenu                                 *:PhpactorContextMenu*
  Show the context menu for the current cursor position.

:[N]PhpactorCopyFile                                       *:PhpactorCopyFile*
  Copy the current file - updating the namespace and class name according to
  the new file location and name

:[N]PhpactorMoveFile                                       *:PhpactorMoveFile*
  Move the current file - updating the namespace and class name according to
  the new file location and name

:[N]PhpactorClassInflect                               *:PhpactorClassInflect*
  Inflect a new class from the current class (e.g. generate an interface for
  the current class)

:[N]PhpactorFindReferences                           *:PhpactorFindReferences*
  Attempt to find all references to the class name or method under the cursor.
  The results will be loaded into the quik-fix list

:[N]PhpactorNavigate                                       *:PhpactorNavigate*
  Navigate - jump to the parent class, interface, or any of the relationships
  defined in `navigation.destinations`
  https://phpactor.github.io/phpactor/configuration.html#reference

:[N]PhpactorChangeVisibility                       *:PhpactorChangeVisibility*
  Rotate the visiblity of the method under the cursor

:[N]PhpactorGenerateAccessors                     *:PhpactorGenerateAccessors*
  Generate accessors for the current class

:[N]PhpactorTransform                                     *:PhpactorTransform*
  Automatically add any missing properties to a class

:PhpactorUpdate                                              *:PhpactorUpdate*
  Update Phpactor to the latest version using the branch defined with
  |g:phpactorBranch|

:PhpactorCacheClear                                      *:PhpactorCacheClear*
  Clear the entire cache - this will take effect for all projects.

:PhpactorStatus                                              *:PhpactorStatus*
  Show some information about Phpactor's status

:PhpactorConfig                                              *:PhpactorConfig*
  Dump Phpactor's configuration

:PhpactorExtensionList                                *:PhpactorExtensionList*
  List all installed extensions

:PhpactorExtensionInstall                          *:PhpactorExtensionInstall*
  Install an extension

:PhpactorExtensionRemove                            *:PhpactorExtensionRemove*
  Remove an extension

:PhpactorClassExpand                                    *:PhpactorClassExpand*
  Expand the class name under the cursor to it's fully-qualified-name

:PhpactorClassNew                                          *:PhpactorClassNew*
  Create a new class. You will be offered a choice of templates.

:PhpactorGotoDefinition                              *:PhpactorGotoDefinition*
  Goto the definition of the class, method or function under the cursor. Open
  the definition in the current window.

:PhpactorGotoDefinitionVsplit                  *:PhpactorGotoDefinitionVsplit*
  As with |:PhpactorGotoDefinition| but open in a vertical split.

:PhpactorGotoDefinitionHsplit                  *:PhpactorGotoDefinitionHsplit*
  As with |:PhpactorGotoDefinition| but open in a horizontal split.

:PhpactorGotoDefinitionTab                        *:PhpactorGotoDefinitionTab*
  As with |:PhpactorGotoDefinition| but open in a new tab

:PhpactorGotoType                                          *:PhpactorGotoType*
  Goto type (class) of the symbol under the cursor.

:PhpactorGotoImplementations                    *:PhpactorGotoImplementations*
  Load all implementations of the class under the cursor into the quick-fix
  list.

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


Phpactor does not assume any mappings automatically, the following mappings
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,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> <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: