How do you execute a lua file in sublime text 3? I tried opening the console and typing build <filename>.lua
. I also looked through the menu's for a build and run. Supposedly saving a file or hitting F7 is supposed to execute lua scripts, but that did not work either. I expected 'helo world' to print in the console upon save and all it said was the file was written.
helo.lua的内容:
print('helo world');
您可以手动创建构建配置 http://sublimetext.info/docs/en/reference/build_systems.html对于卢阿。不过,我建议安装包含一个 Lua 包会更简单。
- 安装包控制 https://packagecontrol.io/installation
- 打开命令面板(Windows 上为 Ctrl-Shift-P 或 Mac 上为 COMMAND + SHIFT + P)
- 键入类似“packins”的内容以获取“Package Control:Install Package”项。
- 短暂暂停后,将出现可用软件包的列表。输入“Lua”以过滤 Lua 包。
- 我个人最喜欢的是“Lua Dev”。选择此软件包,软件包控制将为您下载并安装该软件包。
- 从现在开始,如果您将文件的语法设置为 Lua(Ctrl-Shift-P,“设置语法:Lua”,或单击窗口右下角并选择 Lua),那么按 F7(又名“工具”->“构建”)将使用 Lua 解释器评估该文件。
您可能还需要安装“修复 Mac 路径” https://github.com/int3h/SublimeFixMacPath。在撰写本文时,包控制尚未找到此包。或者,通过在终端中运行以下命令来安装“修复 Mac 路径”:
git clone https://github.com/int3h/SublimeFixMacPath.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/FixMacPath
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)