All Projects ā†’ shawncplus ā†’ Phpcomplete.vim

shawncplus / Phpcomplete.vim

Improved PHP omnicompletion

Projects that are alternatives of or similar to Phpcomplete.vim

Gen tags.vim
Async plugin for vim and neovim to ease the use of ctags/gtags
Stars: āœ­ 288 (-50.52%)
Mutual labels:  ctags, vim-plugin
Vista.vim
šŸŒµ Viewer & Finder for LSP symbols and tags
Stars: āœ­ 1,218 (+109.28%)
Mutual labels:  ctags, vim-plugin
Vim Pizza
My initial attempt at trying to order pizza from within vim.
Stars: āœ­ 414 (-28.87%)
Mutual labels:  vim-plugin
Codequery
A code-understanding, code-browsing or code-search tool. This is a tool to index, then query or search C, C++, Java, Python, Ruby, Go and Javascript source code. It builds upon the databases of cscope and ctags, and provides a nice GUI tool.
Stars: āœ­ 551 (-5.33%)
Mutual labels:  ctags
Palenight.vim
Soothing color scheme for your favorite [best] text editor
Stars: āœ­ 492 (-15.46%)
Mutual labels:  vim-plugin
Vim Startify
šŸ”— The fancy start screen for Vim.
Stars: āœ­ 4,479 (+669.59%)
Mutual labels:  vim-plugin
Vim Markdown Composer
An asynchronous markdown preview plugin for Vim and Neovim.
Stars: āœ­ 501 (-13.92%)
Mutual labels:  vim-plugin
Vim Windowswap
Swap your windows without ruining your layout
Stars: āœ­ 405 (-30.41%)
Mutual labels:  vim-plugin
Vim Gnupg
This script implements transparent editing of gpg encrypted files.
Stars: āœ­ 566 (-2.75%)
Mutual labels:  vim-plugin
Ctags
A maintained ctags implementation
Stars: āœ­ 4,768 (+719.24%)
Mutual labels:  ctags
Srcery Vim
Dark colorscheme for gvim and vim
Stars: āœ­ 518 (-11%)
Mutual labels:  vim-plugin
Tmux Complete.vim
Vim plugin for insert mode completion of words in adjacent tmux panes
Stars: āœ­ 447 (-23.2%)
Mutual labels:  vim-plugin
Vim Markdown Toc
A vim 7.4+ plugin to generate table of contents for Markdown files.
Stars: āœ­ 427 (-26.63%)
Mutual labels:  vim-plugin
Switch.vim
A simple Vim plugin to switch segments of text with predefined replacements
Stars: āœ­ 506 (-13.06%)
Mutual labels:  vim-plugin
Rainbow levels.vim
A different approach to code highlighting.
Stars: āœ­ 415 (-28.69%)
Mutual labels:  vim-plugin
Julia Vim
Vim support for Julia.
Stars: āœ­ 556 (-4.47%)
Mutual labels:  vim-plugin
Nnn.vim
File manager for vim/neovim powered by nĀ³
Stars: āœ­ 414 (-28.87%)
Mutual labels:  vim-plugin
Nerdcommenter
Vim plugin for intensely nerdy commenting powers
Stars: āœ­ 4,454 (+665.29%)
Mutual labels:  vim-plugin
Vim Colors Pencil
Light (& dark) color scheme inspired by iA Writer
Stars: āœ­ 498 (-14.43%)
Mutual labels:  vim-plugin
Traces.vim
Range, pattern and substitute preview for Vim
Stars: āœ­ 568 (-2.41%)
Mutual labels:  vim-plugin

About

Improved PHP omni-completion. Based on the default phpcomplete.vim.

Build Status

Features

  • Correct restriction of static or standard methods based on context ( show only static methods with :: and only standard with ->)
  • Real support for self:: and $this-> with the aforementioned context restriction
  • Constant variable completion (not just define(VARIABLE, 1) but const VARIABLE = 1)
  • Better class detection:
    • Recognize /* @var $yourvar YourClass */ type mark comments
    • Recognize $instance = new Class; class instantiations
    • Recognize $instance = Class::getInstance(); singleton instances
    • Recognize $date = DateTime::createFromFormat(...) built-in class return types
    • Recognize type hinting in function prototypes
    • Recognize types in @param lines in function docblocks
    • Recognize $object = SomeClass::staticCall(...) return types from docblocks
    • Recognize array of objects via docblock like $foo[42]-> or for variables created in foreach
  • Displays docblock info in the preview for methods and properties
  • Updated built-in class support with constants, methods and properties
  • Updated list of PHP constants
  • Updated list of built-in PHP functions
  • Namespace support ( Requires patched ctags )
  • Enhanced jump-to-definition on ctrl+]

Install

Pathogen

  1. Install the pathogen.vim plugin, follow the instructions here

  2. Clone the repository under your ~/.vim/bundle/ directory:

     cd ~/.vim/bundle
     git clone git://github.com/shawncplus/phpcomplete.vim.git
    

Vundle

  1. Install and configure the Vundle plugin manager, follow the instructions here

  2. Add the following line to your .vimrc:

     Plugin 'shawncplus/phpcomplete.vim'
    
  3. Source your .vimrc with :so % or otherwise reload your vim

  4. Run the :PluginInstall commmand

Usage

If you're new to auto-completion in Vim, we recommend reading our "Beginner's Guide".

ctags

In order to support some php features introduced in PHP 5.3 you will have to use a ctags binary that can generate the appropriate tags files. Most unix like systems have a ctags version built in that's really outdated. Please read the "getting better tags" wiki page for more information.

Options

let g:phpcomplete_relax_static_constraint = 1/0 [default 0]
Enables completion for non-static methods when completing for static context (::). This generates E_STRICT level warning, but php calls these methods nontheless.

let g:phpcomplete_complete_for_unknown_classes = 1/0 [default 0]
Enables completion of variables and functions in "everything under the sun" fashion when completing for an instance or static class context but the code can't tell the class or locate the file that it lives in. The completion list generated this way is only filtered by the completion base and generally not much more accurate then simple keyword completion.

let g:phpcomplete_search_tags_for_variables = 1/0 [default 0]
Enables use of tags when the plugin tries to find variables. When enabled the plugin will search for the variables in the tag files with kind 'v', lines like $some_var = new Foo; but these usually yield highly inaccurate results and can be fairly slow.

let g:phpcomplete_min_num_of_chars_for_namespace_completion = n [default 1] Requires patched ctags
This option controls the number of characters the user needs to type before the tags will be searched for namespaces and classes in typed out namespaces in "use ..." context. Setting this to 0 is not recommended because that means the code have to scan every tag, and vim's taglist() function runs extremly slow with a "match everything" pattern.

let g:phpcomplete_parse_docblock_comments = 1/0 [default 0]
When enabled the preview window's content will include information extracted from docblock comments of the completions. Enabling this option will add return types to the completion menu for functions too.

let g:phpcomplete_cache_taglists = 1/0 [default 1]
When enabled the taglist() lookups will be cached and subsequent searches for the same pattern will not check the tagfiles any more, thus making the lookups faster. Cache expiration is based on the mtimes of the tag files.

let g:phpcomplete_enhance_jump_to_definition = 1/0 [default 1]
When enabled the <C-]> will be mapped to phpcomplete#JumpToDefinition() which will try to make a more educated guess of the current symbol's location than simple tag search. If the symbol's location cannot be found the original <C-]> functionality will be invoked

let g:phpcomplete_mappings = {..}
Defines the mappings for the enhanced jump-to-definition.

Recognized keys:

  • jump_to_def: Jumps to the definition in the current buffer
  • jump_to_def_split: Jumps to the definition in a new split buffer
  • jump_to_def_vsplit: Jumps to the definition in a new vertical split buffer
  • jump_to_def_tabnew: Jumps to the definition in a new tab buffer

You change any of them like this in your vimrc:

let g:phpcomplete_mappings = {
  \ 'jump_to_def': ',g',
  \ 'jump_to_def_tabnew': ',t',
  \ }

The keys you don't specify will be mapped to the defaults:

let g:phpcomplete_mappings = {
   \ 'jump_to_def': '<C-]>',
   \ 'jump_to_def_split': '<C-W><C-]>',
   \ 'jump_to_def_vsplit': '<C-W><C-\>',
   \ 'jump_to_def_tabnew': '<C-W><C-[>',
   \}

let g:phpcomplete_add_function_extensions = [...]
let g:phpcomplete_add_class_extensions = [...]
let g:phpcomplete_add_interface_extensions = [...]
let g:phpcomplete_add_constant_extensions = [...]
let g:phpcomplete_remove_function_extensions = [...]
let g:phpcomplete_remove_class_extensions = [...]
let g:phpcomplete_remove_interface_extensions = [...]
let g:phpcomplete_remove_constant_extensions = [...]
Built-in functions, classes, interfaces and constatns are grouped together by the extension. Only the enabled extensions will be loaded for the plugin, the defaultly enabled ones can be found in.

g:phpcomplete_active_function_extensions
g:phpcomplete_active_class_extensions
g:phpcomplete_active_interface_extensions
g:phpcomplete_active_constant_extensions

If you want to enable an extension that is disabled you can add it to the enabled lists in your vimrc. Let's say you want to have the mongo extension's classes and functions to be completed by the plugin, you can add it like this (in your .vimrc):

let g:phpcomplete_add_class_extensions = ['mongo']
let g:phpcomplete_add_function_extensions = ['mongo']

If you want to disable an otherwise enabled one, use the ...remove... version of these options:

let g:phpcomplete_remove_function_extensions = ['xslt_php_4']
let g:phpcomplete_remove_constant_extensions = ['xslt_php_4']

For the available extension files, check the misc/available_extensions. file

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].