sergeyklay / zephir-mode

[ARCHIVED] This repository is archived in favor of https://github.com/zephir-lang/zephir-mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zephir Mode for GNU Emacs

Licence Travis CI Coverage Status MELPA MELPA Stable

This repository is archived in favor of https://github.com/zephir-lang/zephir-mode

A GNU Emacs major mode for editing Zephir code. Provides font-locking, indentation, alignment and navigation support.

Zephir -- is a high level language that eases the creation and maintainability of extensions for PHP. Zephir extensions are exported to C code that can be compiled and optimized by major C compilers such as gcc/clang/vc++. Functionality is exposed to the PHP language. For more information see https://zephir-lang.com .

Features

  1. Syntax highlighting
  2. Indentation and alignment of expressions and statements
  3. Tag navigation (aka imenu)
  4. Speedbar support

Installation

Known to work with GNU Emacs 24.3 and later. Zephir Mode may work with older versions of Emacs, or with other flavors of Emacs (e.g. XEmacs) but this is not guaranteed. Bug reports for problems related to using Zephir Mode with older versions of Emacs will most like not be addressed.

The master of all the material is the Git repository at https://github.com/sergeyklay/zephir-mode .

NOTE: The master branch will always contain the latest unstable version. If you wish to check older versions or formal, tagged release, please switch to the relevant tag.

Using use-package

Add following to your init file:

(use-package zephir-mode
  :ensure t
  :defer t)

Using MELPA

The best way of installing this major mode, at least for GNU Emacs 24, is to use the packaging system. Add MELPA or MELPA Stable to the list of repositories to access this mode. For those who want only formal, tagged releases use MELPA Stable:

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)

Or manually from MELPA with M-x package-refresh-contents and M-x package-install RET zephir-mode .

For those who want rolling releases as they happen use MELPA:

(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

and then use M-x package-list-packages to get to the package listing and install from there. MELPA tracks this Git repository and updates relatively soon after each commit or formal release. For more detail on setting up see MELPA Getting Started.

Using Cask

Add following to your Cask file:

(source melpa)

(depends-on "zephir-mode")

Manual Install

  1. Download zephir-mode.el

  2. Put the file in your Elisp common folder like $HOME/.emacs.d/lisp/

  3. Then you can include like this:

    (add-to-list 'load-path
                 (expand-file-name "lisp" user-emacs-directory))
  4. Add either of the two following lines to your initialization file. The first only loads Zephir Mode when necessary, the 2nd always during startup of GNU Emacs.

    (autoload 'zephir-mode "zephir-mode" nil t)
    ;; OR
    (require 'zephir-mode)
  5. Optionally byte compile zephir-mode.el for faster startup: M-x byte-compile

Spacemacs Users

  1. Download zephir-mode.el

  2. Put the file in Spacemacs private directory: $HOME/.emacs.d/private/local/zephir-mode/zephir-mode.el

  3. Then you can enable zephir-mode in your $HOME/.spacemacs file as follows:

    ;; ...
    dotspacemacs-additional-packages
    '(
      (zephir-mode :location (recip :fetcher file
                                    :path "~/.emacs.d/private/local/zephir-mode/zephir-mode.el")))

Usage

Interactive Commands

Command (For the M-x prompt.) Description
zephir-mode Switches to Zephir Mode.
zephir-mode-version Print version info for Zephir Mode.
zephir-open-mode-github Go to the Zephir Mode GitHub Page.
zephir-open-zephir-github Go to the Zephir GitHub Page.
zephir-open-website-home Go to the Zephir Website.
zephir-current-class Insert current class name if cursor in class context.
zephir-current-namespace Insert current namespace if cursor in namespace context.
zephir-beginning-of-defun Move to the beginning of the current or next function.
zephir-end-of-defun Move to the end of the current or next function.

Any file that matches the glob *.zep is automatically opened in zephir-mode.

Keymapping

Keymaps can be added to the zephir-mode-map variable.

Support

Feel free to ask question or make suggestions in our issue tracker .

Changes

To see what has changed in recent versions of Zephir Mode, see the CHANGELOG.md .

External Links

License

Zephir Mode is open source software licensed under the GNU General Public Licence version 3 .

About

[ARCHIVED] This repository is archived in favor of https://github.com/zephir-lang/zephir-mode

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 93.1%Language:Makefile 6.9%