Questions tagged [sublime-build]

Sublime Text is a cross-platform text and source code editor written by Jon Skinner. One of its features is customizable build systems, allowing for the processing of files through external programs such as compilers, interpreters, and formatters, without leaving the editor.

Build systems let you run your files through external programs without leaving Sublime Text, and see the output they generate.

Build systems configurations are stored in .sublime-build files. These JSON files can contain various keys:

  • selector: allows Sublime Text to find the build, looking for the current file extension
  • target: Sublime Text command to run (by default exec)
  • variants: allows you to provide build options
  • windows: OS-specific configuration
  • linux: OS-specific configuration
  • osx: OS-specific configuration
  • cmd: the command to execute when F7 is pressed
  • file_regex: Perl regex to capture output of cmd
  • line_regex: Perl regex to capture output of cmd
  • working_dir: directory to change the current directory before running cmd
  • encoding: output encoding of cmd
  • env: dictionary of environment variables to be merged before passing them to cmd
  • shell: if true, cmd will be run through the shell
  • path: will replace the current process' PATH before calling cmd
  • syntax: output syntax for highlighting purpose

Here is a simple build, used to run the sass command for .scss and .sass files:

{

    "cmd": [
        "sass",
        "--update",
        "--stop-on-error",
        "--no-cache",
        "--load-path", "${file_path}",
        "--sourcemap=none",
        "$file:../${file_base_name}.css"
    ],

    "selector": "source.sass, source.scss",
    "line_regex": "Line ([0-9]+):",

    "osx": {
        "path": "/usr/local/bin:$PATH"
    },
    "windows": {
        "shell": "true"
    }

}

Links

50 questions
0
votes
2 answers

How to build with swipl on sublime

I'm trying to compile prolog's code on sublime text 3 but I always get [Errno 2] No such file or directory: 'swipl' [cmd: ['swipl', '-f', '', '-t', 'main', '--quiet']] [dir: /Applications/Sublime Text.app/Contents/MacOS] [path:…
0
votes
1 answer

Sublime Text 2 : Having trouble making an OpenGL sublime-build

Just trying to set up a sublime-build for my OpenGL coding on Windows 8.1. This is what I have: { "cmd": [ "gcc -o \"$file\" \"$file_base_name\" -lGLU -lGL -lglut && ./\"$file_base_name\""], "working_dir": "${project_path:${folder}}", "selector":…
An0nx
  • 19
  • 2
  • 9
0
votes
2 answers

Error in custom sublime build for knitr markdown

I'm trying to create my own sublime-build in Sublime Text 3, since the default build in knitr package (https://sublime.wbond.net/packages/knitr) doesn't work (for me). I modified the one in knitr package as follows: { "selector":…
adibender
  • 7,288
  • 3
  • 37
  • 41
-1
votes
1 answer

How can I fix spaces in the Sublime Text Build-System python path?

I am using Sublime Text 4 and I have a problem trying to set up a Build-System for running Python programs on the cmd console. I think it is caused by an space in the name of one of the directories in my path, I have spent hours looking for…
-1
votes
1 answer

Sublime build for Python output in command prompt

I created a build for python in Sublime Text, I expected that the output of the program will appear in the command prompt and it will pause until any key is pressed. But that build disappears after giving output if I use /C option, and with /K…
Vora Arshit
  • 40
  • 1
  • 8
1 2 3
4