Added SML layer
This commit is contained in:
parent
2ccea679da
commit
918c0cf4da
45
contrib/lang/sml/README.md
Normal file
45
contrib/lang/sml/README.md
Normal file
|
@ -0,0 +1,45 @@
|
|||
# SML contribution layer for Spacemacs
|
||||
|
||||
![logo_sml](img/sml.jpeg)
|
||||
|
||||
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
|
||||
**Table of Contents**
|
||||
|
||||
- [SML contribution layer for Spacemacs](#sml-contribution-layer-for-spacemacs)
|
||||
- [Description](#description)
|
||||
- [Install](#install)
|
||||
- [Key Bindings](#key-bindings)
|
||||
- [Form Completion](#form-completion)
|
||||
- [REPL](#repl)
|
||||
|
||||
<!-- markdown-toc end -->
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
Adds support for the [SML](http://www.smlnj.org) programming language.
|
||||
|
||||
## Install
|
||||
|
||||
To use this contribution add it to your `~/.spacemacs`
|
||||
|
||||
```elisp
|
||||
(setq-default dotspacemacs-configuration-layers '(sml))
|
||||
```
|
||||
|
||||
## Key Bindings
|
||||
|
||||
### Form Completion
|
||||
|
||||
Key Binding | Description
|
||||
-----------------|------------------------------------------------------------------------------------------
|
||||
<kbd>M-SPC</kbd> | Inserts a space and completes the form before the cursor.
|
||||
<kbd>\|</kbd> | Inserts a \| and adds a double arrow or copies the function name. Generally just works.
|
||||
|
||||
### REPL
|
||||
|
||||
Key Binding | Description
|
||||
----------------------|-----------------------------------------------------------------
|
||||
<kbd>SPC m s b</kbd> | Send buffer to REPL and switch to REPL buffer in `insert state`
|
||||
<kbd>SPC m s r</kbd> | Send region to REPL and switch to REPL buffer in `insert state`
|
||||
<kbd>SPC m s s</kbd> | Run the sml REPL or switch to it if the REPL is already running
|
BIN
contrib/lang/sml/img/sml.jpeg
Normal file
BIN
contrib/lang/sml/img/sml.jpeg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
44
contrib/lang/sml/packages.el
Normal file
44
contrib/lang/sml/packages.el
Normal file
|
@ -0,0 +1,44 @@
|
|||
;;; packages.el --- sml Layer packages File for Spacemacs
|
||||
;;
|
||||
;; Copyright (c) 2012-2014 Sylvain Benner
|
||||
;; Copyright (c) 2014-2015 Keith Simmons & Contributors
|
||||
;;
|
||||
;; Author: Keith Simmons <keith@the-simmons.net>
|
||||
;; URL: https://github.com/syl20bnr/spacemacs
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
(setq sml-packages
|
||||
'(
|
||||
sml-mode
|
||||
ob-sml
|
||||
)
|
||||
"List of all packages to install and/or initialize. Built-in packages
|
||||
which require an initialization must be listed explicitly in the list.")
|
||||
|
||||
(defvar sml-excluded-packages '()
|
||||
"List of packages to exclude.")
|
||||
|
||||
(defun sml/init-sml-mode ()
|
||||
(use-package sml-mode
|
||||
:mode ("\\.\\(sml\\|sig\\)\\'" . sml-mode)
|
||||
:defer t
|
||||
:commands run-sml
|
||||
:config
|
||||
(progn
|
||||
(evil-leader/set-key-for-mode 'sml-mode
|
||||
;; REPL
|
||||
"msb" 'sml-prog-proc-send-buffer
|
||||
"msr" 'sml-prog-proc-send-region
|
||||
"mss" 'run-sml)
|
||||
(define-key sml-mode-map (kbd "M-<SPC>") 'sml-electric-space)
|
||||
(define-key sml-mode-map (kbd "|") 'sml-electric-pipe))))
|
||||
|
||||
(defun sml/init-ob-sml ()
|
||||
(use-package ob-sml
|
||||
:config
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-do-load-languages
|
||||
'(sml . t))))
|
Loading…
Reference in a new issue