Zephir Mode for GNU Emacs
https://github.com/zephir-lang/zephir-mode
This repository is archived in favor ofA 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
- Syntax highlighting
- Indentation and alignment of expressions and statements
- Tag navigation (aka
imenu
) - 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.
use-package
Using 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
-
Download
zephir-mode.el
-
Put the file in your Elisp common folder like
$HOME/.emacs.d/lisp/
-
Then you can include like this:
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
-
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)
-
Optionally byte compile
zephir-mode.el
for faster startup: M-xbyte-compile
Spacemacs Users
-
Download
zephir-mode.el
-
Put the file in Spacemacs private directory:
$HOME/.emacs.d/private/local/zephir-mode/zephir-mode.el
-
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 .