An Haxe Bundle for Sublime Text 2
- Syntax highlighting for Haxe sources, hxml build files and HSS
- Haxe compiler completion, code hints and error highlighting
- Package and classes discovery/completion supporting hxml classpath (-cp) and haxelib libraries (-lib)
- NME completion, target selection and compilation
- Multiple build/hxml management and automatic generation of hxml files
- Haxelib integration (install / remove libs) with -lib autocompletion
- Code snippets, auto-import, Sublime build system integration
- HScript, Erazor and HSS support
and more to come :)
Sublime Package Control
The most straight-forward way to install the bundle and to keep it up-to-date is through Package Control.
If you want to develop on a forked repo, you can clone it into the Packages folder:
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages git clone https://github.com/<fork author>/haxe-sublime2-bundle.git Haxe
cd ~/.config/sublime-text-2/Packages git clone https://github.com/<fork author>/haxe-sublime2-bundle.git Haxe
Using git bash http://code.google.com/p/msysgit/
cd /c/Users/<username>/AppData/Roaming/Sublime\ Text\ 2/Packages git clone https://github.com/<fork author>/haxe-sublime2-bundle.git Haxe
Restart Sublime Text 2.
- Open your project's directory (where the .hxml or .nmml resides) in Sublime Text, the build file should be detected automatically,
- Create new types through the sidebar's context menu
- Edit your classes (check the cool snippets, like 'prop'-Tab)
- Completion is triggered either automatically by dot and colon keys, or manually by Ctrl+Space.
- Open parenthesis and comma keys display Haxe type hints in the status bar
- Press Ctrl+Shift+B to either automatically generate an hxml file if none exist, edit the build file if only one build exists or select among multiple builds (--next)
- Press Ctrl+Enter to run the current/selected build
- Press Ctrl+I on a qualified class name to shorten it and generate the import statement. Safe to use if the class is already imported.
- Press Ctrl+Shift+L to install a library via haxelib
- Press Ctrl+Shift+H and then :
- Ctrl+Shift+C to create a new class,
- Ctrl+Shift+I to create a new interface,
- Ctrl+Shift+E to create a new enum,
- Ctrl+Shift+T to create a new typedef
haxe_path: Full path to the Haxe compiler, if not already in your PATH ("/usr/bin/haxe" or "C:\Program Files\Haxe\haxe.exe")
haxe_library_path: Full path to the standard lib, overriding HAXE_LIBRARY_PATH
trueby default) : Uses compilation server for building. The server is always used for completion, and may be restarted if needed through the command palette.
Haxe NME is based on a specific .nmml file (the .hxml is generated) which is supported by this bundle.
- press Ctrl+Shift+B to select a NME target
- press Ctrl+Enter to build and run (regular Sublime Text build system won't work)
Tips & tricks
As this bundle displays code hinting for method calls in the “status bar”, you may find it useful to increase its font-size.