A major mode for editing GF code.
| key binding | description |
|---|---|
C-c C-l | load file on GF shell (haskell runtime by default) |
C-c C-b | display GF shell buffer |
C-c C-s | run GF shell |
C-c C-. | show oper or lin’s type signature, if available (only useful for small grammars) |
- syntax highlighting
- indentation support
- integrated GF shell
- display
opertype declaration in minibuffer
if you’d like to have a feature implemented, you should file at ticket at the issue tracker. our current to-do list is there too.
- set MELPA up, if you haven’t already.
M-x package-refresh-contentsM-x package-install RET gf
- install the dependencies:
M-x package-install s M-x package-install ht - clone the repo and put these files where emacs will load them, as in:
$ cd ~/some/path/ $ git clone https://github.com/GrammaticalFramework/gf-emacs-mode
- add to your
.emacsfile:(add-to-list 'load-path "~/some/path/gf-emacs-mode/") (autoload 'gf-mode "gf" "Major mode for editing GF files." t) (add-to-list 'auto-mode-alist '("\\.gf\\(\\|e\\|r\\|cm?\\)\\'" . gf-mode)) (add-to-list 'auto-mode-alist '("\\.cf\\'" . gf-mode)) (add-to-list 'auto-mode-alist '("\\.ebnf\\'" . gf-mode))
to customize gf-mode, load the library and do M-x customize-group
RET gf.
contributions are welcome!
Johan Bockgård wrote most of the mode back in the 2000s (see first commit).