Sublime Forum

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

#1

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++ Single File .sublime-build file – if I could do that, I could simply add an “-I /usr/…” to include additional folders.

As a solution, I am looking for:

  • Use the same .sublime-build that is used in the default C++ Single File Build System, while…
  • Adding additional folders to point to. These additional folders would include header files (ex. armadillo.h)
0 Likes

#2

The file you’re looking for is named C++ Single File.sublime-build and is in the C++ package; this package isn’t stored in the normal package location you might expect because it ships with Sublime, which may be why you’re having problems finding it.

If you use PackageResourceViewer you can open up the C++ package, select the file, then modify it and save it. It will be saved as an override in your package directory, so your changes will take preference to the version included in the package (which will remain untouched).

Note however that if you do this, your override will always override the version in the package, even if it’s updated on a new Sublime release. Not a major deal but something to be aware of at the least.

0 Likes

#3

Is better to use a update proof strategy. This below is to replace the Sublime Text Windows Default shortcuts:

0 Likes

#4

Thanks! This was very helpful, and did what I was looking to do!

1 Like