简体   繁体   English

如何在emacs中打开节点REPL?

[英]How to open a node REPL in emacs?

I'm going through the Coursera Startup Engineering course offered by Stanford. 我正在学习斯坦福大学提供的Coursera初创工程课程。 The assignment is asking me to open a node REPL within emacs by using the command Cc!. 作业要求我使用命令Cc!在emacs中打开节点REPL。 I don't seem to be able to use the '!' 我似乎无法使用'!' that it requires. 它需要的。

The instructor first has me using Cx 3 to split the buffer into two pieces. 讲师首先让我使用Cx 3将缓冲区分为两部分。 Then we are to use Cc! 然后我们要使用抄送! but I can't get it to work. 但我无法正常工作。

I have tried Ctrl-C -> Shift-! 我试过了Ctrl-C-> Shift-! and I get the error message: Cc ! 我收到错误消息:Cc! is undefined 未定义

I have tried enter the '!' 我尝试输入“!” while still holding Cc and also to use the meta key with no luck. 同时仍然保持抄送,并且在没有运气的情况下使用meta键。

Anyone know what I'm doing wrong here? 有人知道我在做什么错吗? Could it be a problem with my keybindings? 我的键盘绑定可能有问题吗?

Link to the tutorial video: https://class.coursera.org/startup-001/lecture/173 链接到教程视频: https : //class.coursera.org/startup-001/lecture/173

  1. Check whether .emacs is present using the command " ls -la .emacs " 使用命令“ ls -la .emacs”检查是否存在.emacs
  2. If it is present use "mv .emacs old.emacs" 如果存在,请使用“ mv .emacs old.emacs”

This should solve your problem, for some more solutions regarding the same problem, check the thread 这应该可以解决您的问题,有关同一问题的更多解决方案,请检查线程

https://class.coursera.org/startup-001/forum/thread?thread_id=3013 https://class.coursera.org/startup-001/forum/thread?thread_id=3013

The Cc keymap is generally mode-specific, so the missing step is that you're probably not in the right mode. Cc键映射通常是特定于模式的,因此缺少的步骤是您可能未处于正确的模式。 The footnote he has mentions the "comint-mode" feature. 他在脚注中提到了“ comint-mode”功能。 when we loads fibonocci.js, he's just in Javascript mode, does the Cx 3, and then uses a keybinding that isn't present by default. 当我们加载fibonocci.js时,他只是处于Javascript模式下,执行Cx 3,然后使用默认情况下不存在的键绑定。

There's some info at how to run node.js interactively in Emacs on Windows . 有关如何在Windows的Emacs中以交互方式运行node.js的一些信息。 You probably don't have to use that however. 但是,您可能不必使用它。

Your instructor has some code in his ~/.emacs - pulled in from a class Github repo - that should be shared with students. 您的老师的〜/ .emacs中有一些代码-从课堂Github存储库中提取-应该与学生共享。 It's probably a good idea to review his lecture segment "Emacs: Installation" in 4b. 在4b中复习他的演讲部分“ Emacs:安装”可能是一个好主意。

git clone https://github.com/startup-class/setup.git (the script in there calls "git clone https://github.com/startup-class/dotfiles.git " too) git clone https://github.com/startup-class/setup.git (其中的脚本也调用“ git clone https://github.com/startup-class/dotfiles.git ”)

It looks like he has a fondness for putting ".sh" on the end of shell scripts. 看起来他喜欢将“ .sh”放在shell脚本的末尾。 Be warned that this is incorrect for shell scripts used as commands, since it unnecessarily exposes an implementation detail, breaking a sort of encapsulation. 请注意,这对于用作命令的shell脚本是不正确的,因为它不必要地公开了实现细节,从而破坏了某种封装。

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

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