Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to enable code completion for Perl in vim?

Tags:

vim

vi

perl

Surprisingly as you get good at vim, you can code even faster than standard IDEs such as Eclipse. But one thing I really miss is code completion, especially for long variable names and functions.

Is there any way to enable code completion for Perl in vim?

like image 706
Edward Tanguay Avatar asked Sep 10 '08 13:09

Edward Tanguay


2 Answers

Ctrl-P (Get Previous Match) and Ctrl-N (Get Next Match) are kind of pseudo code completion. They basically search the file (Backwards for Ctrl-P, Forwards for Ctrl-N) you are editing (and any open buffers, and if you are using TAGS anything in your TAG file) for words that start with what you are typing and add a drop down list. It works surprisingly well for variables and function names, even if it isn't intellisense. Generally I use Ctrl-P as the variable or function I am looking for is usually behind in the code. Also if you keep the same copy of Vim open, it will search the files you have previously opened.

like image 70
Kris Erickson Avatar answered Sep 21 '22 11:09

Kris Erickson


Vim 7 supports omni completion.

For example, I have this in my vimrc

autocmd FileType php set omnifunc=phpcomplete#CompletePHP 

and then, when I press Ctrl-X Ctrl-O in Insert mode, I get a dropdown list of autocomplete possibilities.

Here's an omnicfunc for perl. No idea how well it works though.

like image 28
Mark Biek Avatar answered Sep 19 '22 11:09

Mark Biek