Skip to content

frabbit/haxe-sublime2-bundle

 
 

Repository files navigation

Introduction

An Haxe Bundle for Sublime Text 2

Features

  • 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 :)

Installation

Sublime Package Control

The most straight-forward way to install the bundle and to keep it up-to-date is through Package Control.

Manual installation

Mac OSX

cd /Users/<username>/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/<fork author>/haxe-sublime2-bundle.git HaXe

Linux

cd ~/.config/sublime-text-2/Packages
git clone git://github.com/<fork author>/haxe-sublime2-bundle.git HaXe

Windows

(Using git bash http://code.google.com/p/msysgit/)
cd /c/Users/<username>/AppData/Roaming/Sublime\ Text\ 2/Packages
git clone git://github.com/<fork author>/haxe-sublime2-bundle.git HaXe

Restart Sublime Text 2

Usage

  • 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

Shortcuts

  • 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

Settings

  • 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
  • haxe_build_server_mode (true by default) : Uses compilation server for building. The server is always used for completion, and may be restarted if needed through the command palette.

Targeting NME

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.

Reviews

SublimeText Editor Video Tutorial

Haxe workflow with Sublime Text 2, Php & nme examples

Haxe IDE Choices for Mac OS X

About

Sublime2 bundle for Haxe programming language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.7%
  • Haxe 4.3%