Vim has a function prompt function.It’s just turned off by default, so you don’t know if you don’t read this information.At present, VIM provides automatic syntax completion for popular programming languages.It is very simple to use.In command mode, through the command:
< span class="pun">:set omnifunc=phpcomplete#CompletePHP
enable php auto To complete the function, the next step is to use the shortcut keys to display the code hints when writing (it is not a fully automatic completion function, right).Use the following shortcut keys:
1, first press ctrl+x and then ctrl+o, the function prompt will be displayed.
2.After prompting the function, you can use the arrow keys or ctrl+n, ctrl+p to switch between the drop-down functions.
The example image is as above, after the code hint is displayed , The parameter information of the function will be displayed at the top.If you don't want to execute the above sentence every time you open vim, you can add it to the /etc/vimrc file, and add any of the following lines at the end of the file to realize all vim open files to automatically open the function to prompt the auto-completion function.
autocmd FileType php set omnifunc= phpcomplete#CompletePHP< span class="pln"> set omnifunc= phpcomplete#CompletePHP
this It is to use the function prompt that comes with VIM.VIM can also support another file loading method.
--------------------------------Dividing line--------- ----------------------------
Method two is to download the list of methods first, and then load To vim.Vim itself supports this extended prompt support.The official website of the PHP function list is at: http://svn.php.net/viewvc/phpdoc/doc-base/trunk/funclist.txt, but the official website provides HTML style, too lazy to organize a list of methods, I downloaded the list of methods from the reference file and saved it on this server.So you can directly:
wget http://www.04007.+=k endfunction
The above code realizes that only in the PHP format file with Go to the php function prompt function, enter the vim php file again, use the shortcut key: ctrl+p, and then use the arrow keys or ctrl+n in the same way as the above method ctrl+p to switch between the drop-down functions.However, it should be noted that although both methods implement function prompts, the difference between them is that the prompt function sources are different.The following method is the list of functions we downloaded, and the above method is provided by VIM.
Method two reference article: http://blog.csdn.net/tonyxf121/article/details/45742517
.However, it should be noted that although both methods implement function prompts, the difference between them is that the prompt function sources are different.The following method is the list of functions we downloaded, and the above method is provided by VIM.Method two reference article: http://blog.csdn.net/tonyxf121/article/details/45742517
.However, it should be noted that although both methods implement function prompts, the difference between them is that the prompt function sources are different.The following method is the list of functions we downloaded, and the above method is provided by VIM.Method two reference article: http://blog.csdn.net/tonyxf121/article/details/45742517
0 Comments