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
1 answer

Sublime Text 3 build problem Haml/jQuery $ is not defined

I'm using the sublime text 3 editor Error is the following The loading of jquery reference should be correct.. Is like this on file.haml %script{ :src => "js/jquery-3.3.1.min.js" , :type => "text/javascript"} %script{ :src => "js/jquery-ui.min.js"…
0
votes
1 answer

Sublime build for XML with different extension

I have a project that uses a XML file of the type .uvprojx. I have a sublime build I have found and modified slightly and it works fine but I can't get the build system to auto-detect that this is the build it needs to use. I need to manually go to…
Carlos
  • 105
  • 2
  • 14
0
votes
2 answers

.sublime-build files not present after Sublime Text 3 install

After install of Sublime Text 2 and running a few .py files with CTRL+B, I can find this file in the filesystem: C:\Users\User\AppData\Roaming\Sublime Text 2\Packages\Python\Python.sublime-build However, after installing Sublime Text 3 (portable…
Basj
  • 41,386
  • 99
  • 383
  • 673
0
votes
0 answers

No Output is showing on Sublime text Python Program

I want to run a simple simple print function in python with sublime text. My Python.sublime-build looks like this: `"cmd": [C:\\Users\\Proteeti\\AppData\\Local\\Programs\\Python\\Python36-32\\python.exe", "-u", "$file"], "file_regex": "^[ ]*File…
Proteeti Prova
  • 1,079
  • 4
  • 25
  • 49
0
votes
0 answers

Issues with importing python 3 libraries in Sublime Text 3

I'm on a Mac and I've recently added a python3 (3.6) build for Sublime 3, and it seems to work. However, when I import libraries installed with pip3, I get this strange output in the Sublime IDE. For example, I tried importing Numpy (my script did…
0
votes
1 answer

Sublime text 3 not building a python file

I am trying to build (Ctrl+B) a python (2.7 or 3) file in sublime text 3 in Ubuntu and I am expecting it to show some message at the bottom like [ Finished in 1.2 s ] But it is showing nothing. I even reinstalled the sublime text after completely…
Sunil Kumar
  • 390
  • 1
  • 7
  • 25
0
votes
0 answers

Build output window not updated before application closes on run mode (Windows)

I have a build system that runs a build script then executes the program. The problem is that any output the program does is not printed until the application ends. I tried running the program from the batch script and with the following : { …
cmourglia
  • 2,423
  • 1
  • 17
  • 33
0
votes
1 answer

Adding folder pointers to default .sublime-build files (Sublime Text 3, c++)

I am looking for a straight-forward way to add folder pointers in Sublime Text 3 when I am using it's built-in C++ compiler, C++ Single File Build System. I have written custom .sublime-build files before, but I also cannot find the default file C++…
AaronJPung
  • 1,105
  • 1
  • 19
  • 35
0
votes
1 answer

Confirm location that .sublime-build is looking at (Sublime Text 3, C++) on Windows

I have a custom .sublime-build file in Sublime Text 3 (ST3), where I have included folder that I want it to search for a c++ header file: { "cmd": ["g++", "$file_name", "-o", "${file_base_name}.exe", "-I C:/package/armadillo74002/include", "-L…
AaronJPung
  • 1,105
  • 1
  • 19
  • 35
0
votes
1 answer

Building C++ files on Sublime Text 3 not ending

As you know, you can build a file in Sublime either: 1) Through Ctrl+Shift+B (Build With) -> C++ Single File 2) Through Ctrl+Shift+B (Build With) -> C++ Single File - Run Via the first option I have no problems: file compiles, Sublime confirms, and…
user2719475
0
votes
1 answer

Python 3.5.1 does not recognise any of my libraries (sklearn lxml or urllib)

hey guys im trying to make a new build for python 3 on sublime text 3. This is because none of my newly installed modules do not work. sklearn and lxml, and many others do not work with the shell interpreter. They give the message Traceback…
entercaspa
  • 674
  • 2
  • 7
  • 19
0
votes
2 answers

How to configure a sublime file_regex for *.bas-files

I'm trying to configure a Build System for Freebasic files in Sublime Text3 and want to set the file_regex property to handle the error messages { "selector": "source.bas", "cmd": ["fbc.exe", "$file"], "file_regex": "..." } all i have is something…
fraand
  • 33
  • 3
0
votes
3 answers

How Can I Compile Postgresql (pl/pgsql) Functions from Sublime?

Is there a way to compile pl/psql functions from within Sublime Text 2?
danjuggler
  • 1,261
  • 2
  • 21
  • 38
0
votes
2 answers

Sublime Text 3 Microsoft Edge Build System

so normally you can use the following to create a Build System: { "cmd": ["C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","$file"] } With edge, however, you can't simply start it up by double clicking the .exe found at the…
David Torrey
  • 1,335
  • 3
  • 20
  • 43
0
votes
1 answer

Sublime Text won't output Java println statements in main method

my Sublime Text javac build settings don't work for outputs like System.out.println statements in the main method. I am using this sublime-build (javac): { "cmd": ["javac", "$file"], "file_regex": "^(...*?):([0-9]*):?([0-9]*)", …
christophe
  • 692
  • 4
  • 14
  • 27