Skip to content

alchemyyy/SublimeText4-Premake5-Plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Premake5 Syntax Highlighting & Autocomplete for Sublime Text 4

I fed the Premake5 docs repo into Claude Opus.

Features

Syntax Highlighting

  • Complete Premake5 API coverage - All functions from the official beta 8 documentation
  • Lua base language support - Full Lua 5.x syntax highlighting
  • Premake value constants - Highlighted values for kind, language, system, architecture, etc.
  • Token highlighting - Special highlighting for %{} value tokens and %[] path tokens
  • Command tokens - Recognition of {COPYFILE}, {MKDIR}, {DELETE}, etc.
  • Deprecated API warnings - Deprecated flags are visually marked

Custom Color Scheme

Includes a custom dark color scheme (Catppuccin Mocha-inspired) optimized for Premake5:

Element Color Style
Structure functions (workspace, project, filter) Purple/Mauve Bold
Build functions (files, links, defines) Blue Normal
Global functions (include, require, iif) Teal Normal
Module functions (os.*, path.*, string.*) Teal Normal
Global variables (_ACTION, _OPTIONS) Orange Bold
Value constants (ConsoleApp, C++17, windows) Green Italic
Tokens (%{cfg.buildcfg}) Yellow Bold delimiters
Command tokens ({COPYFILE}, {MKDIR}) Pink Bold
Deprecated flags Red Underline
Keywords (if, then, function) Purple Bold
Strings Green Normal
Numbers Peach Normal
Comments Gray Italic

To use your own color scheme instead, edit Premake5.sublime-settings and comment out the color_scheme line.

Autocomplete

  • 400+ completions covering all Premake5 APIs
  • Smart snippets with tab stops for quick code generation
  • Value suggestions - Context-aware value completions
  • Module functions - Complete coverage of os, path, string, table, http, json, io, term, zip modules
  • Global variables - _ACTION, _OPTIONS, _PREMAKE_VERSION, etc.
  • Token completions - Quick insertion of common tokens like %{cfg.buildcfg}

Templates

  • Complete workspace template
  • Project template
  • Library project template
  • Debug/Release configuration template
  • Precompiled header setup

Build System

  • Integrated build system with variants for:
    • Visual Studio 2017/2019/2022
    • GNU Make (gmake2)
    • Xcode
    • CodeLite
    • Clean and Help commands

Installation

Manual Installation

  1. Download or clone this repository
  2. Copy the Premake5 folder to your Sublime Text packages directory:
    • Windows: %APPDATA%\Sublime Text\Packages\
    • macOS: ~/Library/Application Support/Sublime Text/Packages/
    • Linux: ~/.config/sublime-text/Packages/
  3. Restart Sublime Text

Package Control (if available)

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Select "Package Control: Install Package"
  3. Search for "Premake5"
  4. Press Enter to install

Usage

File Recognition

The plugin automatically activates for:

  • Files named premake5.lua or premake4.lua
  • Files starting with -- Premake or -- premake

For other Lua files, manually set the syntax:

  1. Open Command Palette
  2. Select "Set Syntax: Premake5"

Autocomplete

  • Start typing any Premake5 function name
  • Use Tab to navigate through snippet placeholders
  • Type premake5_ to see available templates

Building

  1. Open your premake5.lua file
  2. Press Ctrl+B (or Cmd+B on macOS) to build
  3. Use Ctrl+Shift+B to select a build variant

Key Bindings

  • Ctrl+Shift+F - Insert filter {} to reset filters

Supported Premake5 API (Beta 8)

Structure Functions

workspace, project, group, filter, configurations, platforms, location, filename, startproject, uuid, externalproject, rule, usage, uses

Build Settings

kind, language, architecture, system, toolset, files, removefiles, links, libdirs, includedirs, externalincludedirs, defines, undefines, symbols, optimize, warnings, buildoptions, linkoptions, targetdir, targetname, objdir, vpaths, pchheader, pchsource, forceincludes, and 150+ more...

C/C++ Settings

cppdialect, cdialect, runtime, staticruntime, exceptionhandling, rtti, floatingpoint, vectorextensions, characterset, clr, inlining, callingconvention, visibility, pic, sanitize, openmp, linktimeoptimization

Debugging

debugargs, debugdir, debugcommand, debugenvs, debugformat

Build Commands

prebuildcommands, postbuildcommands, prelinkcommands, buildcommands, rebuildcommands, cleancommands

Module Functions

  • os: chdir, copyfile, execute, findheader, findlib, getcwd, host, isdir, isfile, istarget, matchfiles, mkdir, outputof, remove, uuid, etc.
  • path: getabsolute, getbasename, getdirectory, getextension, join, normalize, translate, etc.
  • string: contains, endswith, startswith, explode, hash, sha1
  • table: contains, deepcopy, flatten, implode, isempty, join, keys, merge
  • http: download, get, post
  • json: decode, encode
  • io: readfile, writefile
  • zip: extract

Tokens

  • Value tokens: %{wks.name}, %{prj.location}, %{cfg.buildcfg}, %{file.name}, etc.
  • Command tokens: {COPYFILE}, {COPYDIR}, {MKDIR}, {DELETE}, {MOVE}, {RMDIR}, etc.

About

Syntax highlighting, autocomplete, and some other stuff

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors