- [x] ~ZetZ~ menu
August 22, 2020 · View on GitHub
#+TITLE: ZetZ-mode
#+AUTHOR: damon-kwok
#+EMAIL: damon-kwok@outlook.com
#+DATE: 2020-07-18
#+OPTIONS: toc:nil creator:nil author:nil email:nil timestamp:nil html-postamble:nil
#+TODO: TODO DOING DONE
#+html:
[[https://github.com/damon-kwok/zetz-mode/blob/master/COPYING][https://img.shields.io/github/license/damon-kwok/zetz-mode?logo=gnu&.svg]]
[[https://www.patreon.com/DamonKwok][https://img.shields.io/badge/Support%20Me-%F0%9F%92%97-ff69b4.svg]]
[[https://melpa.org/#/zetz-mode][file:https://melpa.org/packages/zetz-mode-badge.svg]]
[[https://stable.melpa.org/#/zetz-mode][file:https://stable.melpa.org/packages/zetz-mode-badge.svg]]
An Emacs major mode for the [[https://github.com/zetzit/zz/blob/master/README.md][ZetZ]] programming language.
- Screenshot
[[https://github.com/damon-kwok/zetz-mode][file:screenshot.png]]
*** DOING Features
- Syntax highlighting (font-lock)
- Indentation
- Whitespace character dsiplay
- Workspace support
- Compilation integration
- Code navigation (using
imenu) - Go to definition (using
ctags) - Code completion (using
company-mode) - Auto format on save
- [x] ZetZ menu
- [x] TODO highlighting
- [x] Rainbow delimiters
- [x] Fill column indicator
- [x] Code folding
*** Installation
- using MELPA
This package can be obtain from
[[http://melpa.org/#/zetz-mode][MELPA]] or
[[http://stable.melpa.org/#/zetz-mode][MELPA Stable]]. The
masterbranch is continuously deployed toMELPA, and released versions are deployed toMELPA Stable.
M-x package-install RET zetz-mode RET
Right now zetz-mode doesn't take a lot of configuration (i.e.
it's too simple to need any).
#+BEGIN_SRC elisp
(require 'zetz-mode)
(define-key zetz-mode-map (kbd "
#+BEGIN_SRC elisp
(add-hook 'zetz-mode-hook (lambda ()
(require 'whitespace)
(whitespace-mode)
(setq-local whitespace-style ;;
'(face spaces tabs newline space-mark tab-mark newline-mark trailing))
;; Make whitespace-mode and whitespace-newline-mode
;; use "¶" for end of line char and "▷" for tab.
(setq-local whitespace-display-mappings
;; all numbers are unicode codepoint in decimal. e.g. (insert-char 182 1)
'((space-mark 32 [183] [46]) ;; SPACE 32 「 」, 183 MIDDLE DOT 「·」, 46 FULL STOP 「.」
(newline-mark 10 [182 10]) ;; LINE FEED,
(tab-mark 9 [9655 9] [92 9])))
;;
(require 'yafolding)
(defalias 'yafolding-hide-element 'zetz-folding-hide-element)
(yafolding-mode t)
;;
(require 'company-ctags)
(with-eval-after-load 'company (company-ctags-auto-setup))
;;
(require 'rainbow-delimiters)
(rainbow-delimiters-mode t)
;;
(require 'fill-column-indicator)
(setq-local fci-rule-column 80)
(setq-local fci-handle-truncate-lines nil)
(setq-local fci-rule-width 1)
(setq-local fci-rule-color "grey30")
;;
(require 'hl-todo)
(hl-todo-mode)
(setq-local hl-todo-keyword-faces ;;
'(("TODO" . "green")
("FIXME" . "yellow")
("DEBUG" . "DarkCyan")
("GOTCHA" . "red")
("STUB" . "DarkGreen")))))
#+END_SRC
- using [[https://github.com/jwiegley/use-package][use-package]] and [[https://github.com/raxod502/straight.el][straight.el]]
#+BEGIN_SRC elisp
(use-package zetz-mode
:straight (zetz-mode
:type git
:host github
:repo "damon-kwok/zetz-mode"
:files ("tokens" "zetz-mode.el"))
:config
:bind-keymap
("