Difference between revisions of "Sublime Text"
(Change configuration to support ST2 Projects and parse errors) |
Albur godwin (talk | contribs) m (→Instalation: misspelling) |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | Fast and customizable cross-platform code editor. | |
− | + | [[File:lualove.png|right|thumb|Sublime Text with [https://packagecontrol.io/packages/Lua%20Love Lua Love package] on Linux]] | |
− | === | + | == Lua Love package == |
− | |||
− | + | The [https://packagecontrol.io/packages/Lua%20Love Lua Love Package] provides syntax highlighting, snippets, autocompletion and build systems. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === Installation === | |
− | <source lang=" | + | # Install [https://packagecontrol.io/installation Package Control] and restart Sublime Text |
+ | # Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> to open the '''Command palette''' and enter '''Package Control: Install Package''' | ||
+ | # Wait until another input field appears and install the '''Lua Love''' package | ||
+ | # In the '''Command palette''' enable syntax highlighting with '''Set Syntax: LOVE''' | ||
+ | # Now select build system with <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>B</kbd> to '''LuaLove''' and then you can use <kbd>Ctrl</kbd>+<kbd>B</kbd> to start LOVE. | ||
+ | # '''Optional''': Set LOVE syntax as default for all .lua files - <code>View</code>→<code>Syntax</code>→<code>Open all with current extension as...</code>→<code>LOVE</code> | ||
+ | # '''Optional''': If LOVE is not in your [[PATH]] variable, go to <code>Preferences</code>→<code>Package Settings</code>→<code>Lua Love</code> and add: | ||
+ | <source lang="json"> | ||
{ | { | ||
− | " | + | "build_system.love.cmd": ["absolute/path/to/love/executable", "${project_path:${folder:${file_path}}}"] |
− | |||
− | |||
} | } | ||
</source> | </source> | ||
− | |||
− | + | === Console output === | |
+ | By default the console in Sublime Text will not display any output, such as <code>print()</code> calls, until the LOVE application has been closed. | ||
− | + | To make the console output display live add the following code to the top of your <code>main.lua</code> file, or inside <code>[[conf.lua]]</code>: | |
− | |||
− | |||
− | |||
− | To make the console output display live add the following code to the top of your main.lua file, or inside [[conf.lua]]: | ||
<source lang="lua"> | <source lang="lua"> | ||
− | io.stdout:setvbuf( | + | io.stdout:setvbuf('no') |
</source> | </source> | ||
− | == Jumping to errors == | + | === Jumping to errors === |
If there was an error during execution, you can use the F4 (next error) and SHIFT-F4 (previous error) to go through the errors that lua encountered. | If there was an error during execution, you can use the F4 (next error) and SHIFT-F4 (previous error) to go through the errors that lua encountered. | ||
== See also == | == See also == | ||
− | * [ | + | * [https://www.sublimetext.com/ Sublime Text Website] |
− | * [ | + | * [https://stackoverflow.com/questions/16338523/live-console-output-in-sublime-text-2 Stack Overflow question about console output] |
− | |||
[[Category:Software]] | [[Category:Software]] | ||
+ | [[Category:Editor integration]] | ||
− | {{#set:Name=Sublime Text | + | {{#set:Name=Sublime Text}} |
+ | {{#set:Author=Jon Skinner, Sublime HQ}} | ||
+ | {{#set:License=Shareware}} | ||
+ | {{#set:Type=Editor}} | ||
+ | {{#set:Status=Active maintenance}} | ||
{{#set:Description=Source Code Editor}} | {{#set:Description=Source Code Editor}} | ||
− | {{#set: | + | {{#set:Screenshot=File:lualove.png}} |
Latest revision as of 07:44, 16 February 2024
Fast and customizable cross-platform code editor.
Lua Love package
The Lua Love Package provides syntax highlighting, snippets, autocompletion and build systems.
Installation
- Install Package Control and restart Sublime Text
- Press Ctrl+Shift+P to open the Command palette and enter Package Control: Install Package
- Wait until another input field appears and install the Lua Love package
- In the Command palette enable syntax highlighting with Set Syntax: LOVE
- Now select build system with Ctrl+Shift+B to LuaLove and then you can use Ctrl+B to start LOVE.
- Optional: Set LOVE syntax as default for all .lua files -
View
→Syntax
→Open all with current extension as...
→LOVE
- Optional: If LOVE is not in your PATH variable, go to
Preferences
→Package Settings
→Lua Love
and add:
{
"build_system.love.cmd": ["absolute/path/to/love/executable", "${project_path:${folder:${file_path}}}"]
}
Console output
By default the console in Sublime Text will not display any output, such as print()
calls, until the LOVE application has been closed.
To make the console output display live add the following code to the top of your main.lua
file, or inside conf.lua
:
io.stdout:setvbuf('no')
Jumping to errors
If there was an error during execution, you can use the F4 (next error) and SHIFT-F4 (previous error) to go through the errors that lua encountered.
See also