Vim can auto-complete syntax for some of the most popular programming languages, but it's disabled by default.
While in command mode, enter the following.
:set omnifunc=phpcomplete#CompletePHP
To start using PHP auto completion, press the Ctrl + x followed by Ctrl + o keys while writing some PHP functions.
Below is an example screenshot when pressing Ctrl + x followed by Ctrl + o after typing dat
Do note the function description provided at the top of the screen.
Automatically enable PHP autocomplete for every PHP file
To enable PHP to autocomplete every time you open a PHP file, add this to your ~/.vimrc;
autocmd FileType php set omnifunc=phpcomplete#CompletePHP

Author: Mohd Shakir Zakaria
Mohd Shakir Zakaria is a skilled cloud architect with a background in development, entrepreneurship, and open-source advocacy. As the founder of Simplified Guide, he helps others understand the complexities of computing, making tech concepts accessible to all.

Mohd Shakir Zakaria is a skilled cloud architect with a background in development, entrepreneurship, and open-source advocacy. As the founder of Simplified Guide, he helps others understand the complexities of computing, making tech concepts accessible to all.
Discuss the article:
Comment anonymously. Login not required.