[英]How to run a program in Atom Editor?
I found Atom editor as good free alternative to Sublime text editor.我发现Atom编辑器是 Sublime 文本编辑器的不错的免费替代品。 Not able to find a straightforward way to run a program in Atom editor.
无法找到在 Atom 编辑器中运行程序的直接方法。 In my case, I am trying to run a java program.
就我而言,我正在尝试运行一个 java 程序。 Please let me know if it's possible?
请让我知道是否可能? If yes, please describe the steps to follow.
如果是,请描述要遵循的步骤。
For C
/ C++
programs there's very good package gpp-compiler .对于
C
/ C++
程序,有非常好的包gpp-compiler 。
Shortcuts:快捷方式:
You can go settings, select packages and type atom-runner
there if your browser can't open this link.如果您的浏览器无法打开此链接,您可以进入设置,选择包并在那里输入
atom-runner
。
To run your code do Alt + R if you're using Windows
in Atom
.如果您在
Atom
使用Windows
,请执行Alt + R运行您的代码。
If you know how to launch your program from the command line then you can run it from the platformio-ide-terminal
package's terminal.如果您知道如何从命令行启动程序,那么您可以从
platformio-ide-terminal
包的终端运行它。 See platformio-ide-terminal
provides an embedded terminal within the Atom text editor.参见
platformio-ide-terminal
在 Atom 文本编辑器中提供了一个嵌入式终端。 So you can issue commands, including commands to run your Java program, from within it.因此,您可以从其中发出命令,包括运行 Java 程序的命令。 To install this package you can use APM with the command:
要安装此软件包,您可以通过以下命令使用 APM:
$ apm install platformio-ide-terminal --no-confirm
Alternatively, you can install it from the command palette with:或者,您可以从命令面板安装它:
platformio-ide-terminal
.platformio-ide-terminal
。This package in Atom can run scripts. Atom 中的这个包可以运行脚本。
press Alt+X for the running script.按 Alt+X 运行脚本。
For running javascript you need to install 'node js'要运行 javascript,您需要安装“node js”
Also pressing ctrl+shift+i in atom gives developer option like chrome同时在 atom 中按 ctrl+shift+i 会提供开发人员选项,例如 chrome
you can test javascript code side by side in atom editor.您可以在 atom 编辑器中并排测试 javascript 代码。
为了使其在 Windows 上正常工作,您需要在系统环境变量中手动设置JDK的路径( ...\\jdk1.x.x_xx\\bin
)。
You can try to use the runner in atom Hit Ctrl+R (Alt+R on Win/Linux) to launch the runner for the active window.您可以尝试使用 atom 中的运行器 Hit Ctrl+R(在 Win/Linux 上为 Alt+R)来启动活动窗口的运行器。 Hit Ctrl+Shift+R (Alt+Shift+R on Win/Linux) to run the currently selected text in the active window.
按 Ctrl+Shift+R(在 Win/Linux 上为 Alt+Shift+R)以在活动窗口中运行当前选定的文本。 Hit Ctrl+Shift+C to kill a currently running process.
按 Ctrl+Shift+C 以终止当前正在运行的进程。 Hit Escape to close the runner window
点击 Escape 关闭跑步者窗口
You can run specific lines of script by highlighting them and clicking shift + ctrl + b您可以通过突出显示并单击shift + ctrl + b来运行特定的脚本行
You can also use command line by going to the root folder and writing: $ node nameOfFile.js
您也可以通过转到根文件夹并编写以下内容来使用命令行:
$ node nameOfFile.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.