Emacs如何在C上自动完成包含文件的文字? [英] Emacs how to auto-complete words of include files on C?

查看:165
本文介绍了Emacs如何在C上自动完成包含文件的文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使Emacs完成C文件中的单词?

How can I make Emacs to complete words that are in C include files ?

#include <stdio.h>
int main(){
print//<-- this is where I want it to complete printf

最简单的方法是什么? (比 Cedet 更简单)

What's the simplest way? (something simpler than Cedet)

推荐答案

首先为源代码生成标签,并包含您想要自动完成的文件。请参阅我的博文,了解有关使用标签< a>如果您以前没有使用标签表。

First generate tags for the source and include files you'd like to be able to autocomplete for. See my blogpost for tips on using tags if you didn't use tag tables before.

现在,如果您有一个包含stdio.h的TAGS表,那么您可以使用命令`complete-tag'。

Now if you have a TAGS table that includes the stdio.h, then you can autocomplete 'printf' using the command `complete-tag'.

也许将`complete-tag'绑定到一个键:

Perhaps bind `complete-tag' to a key:

(global-set-key [f3] 'complete-tag) 

这篇关于Emacs如何在C上自动完成包含文件的文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆