简体   繁体   English

Emacs键绑定以运行make

[英]Emacs key binding to run make

I am working on a C++ project and I want to bind the F10 key in order for the tests to run. 我正在一个C ++项目上,我想绑定F10键以便运行测试。 The tests are the default target of a Makefile. 测试是Makefile的默认目标。 How can I do this? 我怎样才能做到这一点?

To literally do what you want: 要按照字面意思做,请执行以下操作:

(local-set-key [(f10)] (lambda () (interactive)(compile "make"))) (本地设置键[[f10)](lambda()(交互式)(编译“ make”)))

However, you can use keyboard macros solve general problems like this in future. 但是,将来您可以使用键盘宏解决类似的一般问题。 Or use `repeat-last-complex-command' to look at the Lisp form of your last action to use in your own definition. 或使用“ repeat-last-complex-command”查看您要在自己的定义中使用的最后一个动作的Lisp形式。

将f10绑定到命令compile

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

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