Skip to content

Instantly share code, notes, and snippets.

@complex857
Last active December 16, 2015 18:18
Show Gist options
  • Save complex857/5476241 to your computer and use it in GitHub Desktop.
Save complex857/5476241 to your computer and use it in GitHub Desktop.
Please try out phpcomplete.vim with these test files.
<?php
class FooClass {
public function findme($a, $b = 'foo') {
}
public function findme_too($a, $b = 'foo') {
}
}
  1. Save the gist files to a directory

  2. Open vim from that directory

  3. :echo tagfiles() should print ['tags'], so we can confirm tags found, the file was generated with ctags -R .

  4. Open test.php with :e test.php

  5. Hit <c-x><c-o> at the marked place (at the end of line 4)

  6. In the completion popup you should see:

     findme    ( f $a, $b = 'foo'
     findme_too( f $a, $b = 'foo'
    

This was tested with https://github.com/shawncplus/phpcomplete.vim/tree/6f093362b11b6e92c0f51075148b93a42859e69f commit.

!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
FooClass foo.php /^class FooClass {$/;" c
b foo.php /^ public function findme($a, $b = 'foo') {$/;" v
b foo.php /^ public function findme_too($a, $b = 'foo') {$/;" v
f test.php /^$f = new FooClass;$/;" v
findme foo.php /^ public function findme($a, $b = 'foo') {$/;" f
findme_too foo.php /^ public function findme_too($a, $b = 'foo') {$/;" f
<?php
$f = new FooClass;
$f->fi // <-- hit <c-x><c-o> here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment