简体   繁体   English

在emacs-prelude中触发自动完成

[英]Triggering autocomplete in emacs-prelude

I installed emacs prelude in cygwin via the simple curl installation. 我通过简单的curl安装在cygwin中安装了emacs prelude。 I open a test.js file and try typing "document." 我打开一个test.js文件,然后尝试键入“文档”。 to see autocomplete but nothing pops up. 看到自动完成,但没有弹出。 Admittedly I'm totally an emacs/prelude newbie, is there something else I should be doing to get it to autocomplete? 诚然,我完全是emacs / Prelude的新手,我还应该做些其他事情来使其自动完成吗?

  1. Does your Prelude installation include library Autocomplete ? 您的Prelude安装中是否包括库Autocomplete And is that what you mean by "autocomplete"? 这就是您所说的“自动完成”吗?

  2. Give a recipe showing what keys you hit and what you expected to happen vs what actually happened. 给出一个配方,显示您按下了哪些键,以及预期发生的情况与实际发生的情况。

  3. Consult the Prelude manual . 查阅Prelude 手册

  4. Ask the preluddites themselves (sorry; couldn't resist): emacs-prelude@googlegroups.com . 问问自己的偏见者(抱歉;无法抗拒): emacs-prelude@googlegroups.com

I see only a few Google hits in English for all three keywords: " emacs prelude autocomplete ", and none of them mention using Prelude and Autocomplete together. 我只看到三个英文关键词的谷歌命中率:“ emacs prelude autocomplete ”,没有一个提到使用Prelude和Autocomplete。

Your question is too general, I am assuming by auto-completion you mean 您的问题太笼统了,我假设通过自动补全来表示

A popup that displays the possible completions for currently typed word and allows you select one of the candidates 弹出窗口显示当前键入的单词的可能补全,并允许您选择候选单词之一

Something like this 像这样

在此处输入图片说明

Last time I checked prelude did not come with such autocomplete but you can configure emacs to have this kind of completions. 上次我检查前奏没有提供这种自动完成功能,但是您可以将emacs配置为具有这种自动完成功能。 You will have to install a library that provides the completion UI, I know of three libraries that do this in emacs (ordered according to my familiarity with them) 您将必须安装一个提供完成UI的库,我知道emacs中有三个库(根据我对它们的熟悉程度排序)

1) auto-complete 1) 自动完成

2) company 2) 公司

3) completion-ui 3) 完成用户界面

You can install any one of these ( auto-complete and company have a good a number of backends, I do not know much about completion-ui ). 您可以安装其中的任何一种( auto-completecompany都有大量的后端,我不太了解auto-complete completion-ui )。 If you are using emacs 24 this will be as simple as Mx list-packages RET , marking the package to be installed with I and then typing X (for auto-complete you will need to add melpa to your package archive, refer to the websites above for more on installation) 如果您使用的是emacs 24,则就像Mx list-packages RET一样简单,标记要用I安装的软件包,然后键入X (要auto-complete您需要将melpa添加到您的软件包档案中,请参阅网站以上有关安装的更多信息)

These will provide a basic completion interface. 这些将提供基本的完成界面。 auto-complete by default offers words in current buffer for auto-completion. auto-complete默认为自动完成当前缓冲区提供字。 However for 'intelligent' auto-completion you will need to configure these to use a completion backend. 但是,对于“智能”自动完成,您将需要配置它们以使用完成后端。 This will vary according to the individual language you want completion (eg. jedi for python, tern for javascript, eclim for java etc), as such you will need to ask specific questions to get helpful answers. 这将根据您要完成的单个语言而有所不同(例如python的jedi,javascript的tern,java的eclim等),因此您将需要提出一些具体问题以获得有用的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM