Skip to content

๐Ÿ™ Gleam support for Emacs

License

Apache-2.0, GPL-3.0 licenses found

Licenses found

Apache-2.0
LICENSE-apache
GPL-3.0
LICENSE-gpl
Notifications You must be signed in to change notification settings

J3RN/gleam-mode

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

43 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

An Emacs Major Mode for Gleam

This mode uses tree-sitter under-the-hood for syntax highlighting and code navigation.

gleam-mode.mp4

Setup

This project will eventually be hosted on MELPA. However, until that time, the best way to install this is first to clone the project:

$ git clone --recurse-submodules [email protected]:gleam-lang/gleam-mode

Then you'll need to load this from your init script (~/.emacs or ~/.config/emacs/init.el).

use-package (recommended)

(use-package gleam-mode
  :load-path "~/path/to/gleam-mode")

Replace ~/path/to/gleam-mode with the path where you cloned gleam-mode.

vanilla

(add-to-list 'load-path "~/path/to/gleam-mode")
(load-library "gleam-mode")

Replace ~/path/to/gleam-mode with the path where you cloned gleam-mode.

Configuration

gleam-mode ships with a gleam-format command that is not bound by default to any keybinding. To bind it:

use-package

Add :bind (:map gleam-mode-map (<binding> . gleam-format)) to your use-package declaration. e.g.

(use-package gleam-mode
  :load-path "~/path/to/gleam-mode"
  :bind (:map gleam-mode-map
              ("C-c g f" . gleam-format)))

(here "C-c g f" means Control C followed by g followed by f)

vanilla

Add the following after the lines where you setup gleam-mode:

(define-key gleam-mode-map (kbd "C-c g f") 'gleam-format)

(here "C-c g f" means Control C followed by g followed by f)

TODO

  • Syntax highlighting
  • Indentation (at least somewhat)
  • Formatting
  • Completion?
  • REPL?

License

This program is licensed under The Apache License, Version 2.0 or, at your option, under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. See LICENSE-apache for the terms of the Apache License, Version 2.0 or LICENSE-gpl for the terms of the GNU Public License, Version 3.

About

๐Ÿ™ Gleam support for Emacs

Resources

License

Apache-2.0, GPL-3.0 licenses found

Licenses found

Apache-2.0
LICENSE-apache
GPL-3.0
LICENSE-gpl

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%