views:

180

answers:

3

Vim completes words and lines with CTRL-X P and CTRL-L. There's a Emacs plugin called Company mode but this plugin interfere and cause conflicts with lots of things within Emacs (with global linum and yasnippets). I know that I can complete words with CTRL-/ in Emacs. But it is possible to take previously written lines to complete code?

+3  A: 

Maybe you're looking for hippie-expand? From that web page (as of this writing, anyway):

HippieExpand looks at the word before point and tries to expand it in various ways including expanding from a fixed list (like ‘expand-abbrev’’), expanding from matching text found in a buffer (like‘dabbrev-expand’’) or expanding in ways defined by your own functions. Which of these it tries and in what order is controlled by a configurable list of functions.

For a comprehensive list of completion options visit the emacs wiki page on completion.

Bryan Oakley
+1  A: 

There are a gazillion ways to do completion in Emacs. Some are mode specific, some inline, some configurable and what not. Here is a list of modes that might help you.

Noufal Ibrahim
A: 

Also worth noting: if your window manager does not steal Alt-tab, emacs will auto-complete with Alt-tab (I set up my window manager to user the "windows key" instead of alt for this very reason).

Justin Smith