Skip to content

🐴 Pony syntax highlighting, Code formatting, Playground and more things for Emacs.

Notifications You must be signed in to change notification settings

ponylang/ponylang-mode

Repository files navigation

Pony Mode

Emacs Logo MELPA MELPA Stable GitHub contributors PR's Welcome Zulip

An Emacs major mode for the Pony programming language.

  • Screenshot screenshot

Features

  • Syntax highlighting (font-lock)
  • Indentation
  • Code formatting
  • TODO highlighting
  • Rainbow delimiters
  • Whitespace character dsiplay
  • Fill column indicator
  • Ponylang menu
  • Workspace support
  • Code folding
  • Comment and Uncomment (M-;)
  • Compilation integration
  • Code navigation (using imenu)
  • Go to definition (using ctags)
  • Code completion (using company-mode)
  • Playground

Installation

Using MELPA

This package can be obtain from MELPA or MELPA Stable. The main branch is continuously deployed to MELPA, and released versions are deployed to MELPA Stable.

M-x package-install [RET] ponylang-mode [RET]

Right now ponylang-mode doesn't take a lot of configuration (i.e. it's too simple to need any). If you want to make sure your indentation matches that in the ponyc project's examples, you can use something like this:

(require 'ponylang-mode)
(setq ponylang-banner 1) ;; 0: None 1: Word (Default) 2: Horse 3: Knight
(define-key ponylang-mode-map (kbd "<f6>")  'ponylang-menu)
  • Customize banner:
(setq ponylang-banner "¯\\_(ツ)_/¯")

(setq ponylang-banner "
             _|\\ _/|_,
           ,((\\\\``-\\\\\\\\_
         ,(())      `))\\
       ,(()))       ,_ \\
      ((())'   |        \\
      )))))     >.__     \\
      ((('     /    `-. .c|
              /        `-`'")
(use-package ponylang-mode
  :ensure t
  :init
  (setq ponylang-banner 1)
  :config
  :bind-keymap
  ("<f6>" . ponylang-menu))

Optional

  • pony-snippets Pony-Snippets is a collection of YASnippet Pony snippets for Emacs.
  • flycheck-pony Flycheck-pony is an Emacs mode that supports on the fly syntax checking of Pony files.
  • helm-xref Helm interface for xref, It can improve the experience of using code jump.

For Emacs beginner

Testing

The tests require ERT. To run them, eval ponylang-test.el and run M-x ert [RET] t [RET]

Attribution

Big thanks to Austin Bingham who did the first version of ponylang-mode. We wouldn't be where we are now without your initial work Austin!

And a huge thanks to Damon Kwok who fixed a number of bugs and added a number of new features to ponylang-mode. You rock Damon!