Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shen layer #3619

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 58 additions & 0 deletions layers/+lang/shen/README.org
@@ -0,0 +1,58 @@
#+TITLE: Shen contribution layer for Spacemacs

[[file:img/shen.gif]]

* Table of Contents :TOC@4:
- [[#description][Description]]
- [[#install][Install]]
- [[#keybindings][Keybindings]]
- [[#eval][Eval]]
- [[#compile][Compile]]
- [[#repl][REPL]]
- [[#help][Help]]

* Description

Adds support for the [[http://www.shenlanguage.org/][Shen]] programming language via [[https://github.com/eschulte/shen-mode][shen-mode and inf-shen]].

* Install

To use this contribution add it to your =~/.spacemacs=

#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(shen))
#+END_SRC

* Keybindings

** Eval

| Key Binding | Description |
| =SPC m e l= | Eval last sexp |
| =SPC m e d= | Eval defun |
| =SPC m e g= | Eval defun and switch to REPL |
| =SPC m e r= | Eval region |
| =SPC m e t= | Eval region and swith to REPL |


** Compile

| Key Binding | Description |
| =SPC m f= | Compile file |
| =SPC m d= | Compile defun |
| =SPC m g= | Compile defun and swith to REPL |

** REPL

| Key Binding | Description |
| =SPC m s i= | Start REPL |
| =SPC m s s= | Switch to REPL |
| =SPC m s l= | Load file into REPL |

** Help

| Key Binding | Description |
| =SPC m h a= | Show arglist |
| =SPC m h s= | Describe symbol |
| =SPC m h f= | Show function documentation |
| =SPC m h v= | Show variable documentation |
Binary file added layers/+lang/shen/img/shen.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions layers/+lang/shen/packages.el
@@ -0,0 +1,52 @@
;;; packages.el --- Shen Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

(setq shen-packages
'(shen-mode
;; inf-shen is not in GNU ELPA, pending FSF copyright paperwork
(inf-shen :location (recipe :fetcher git
:repo "https://github.com/eschulte/shen-mode.git"
:files ("inf-shen.el")))))

(defun shen/init-shen-mode ()
(use-package shen-mode
:defer t
:mode "\\.shen\\'"
:config
(progn
(evil-leader/set-key-for-mode 'shen-mode
;; e - eval
"mel" 'shen-eval-last-sexp
"med" 'shen-eval-defun
"meg" 'shen-eval-defun-and-go
"mer" 'shen-eval-region
"met" 'shen-eval-region-and-go

;; compile
"mf" 'shen-compile-file
"md" 'shen-compile-defun
"mg" 'shen-compile-defun-and-go

;; s - REPL
"msi" 'inferior-shen
"mss" 'switch-to-shen
"msl" 'shen-load-file

;; h - help
"mha" 'shen-show-arglist
"mhs" 'shen-describe-sym
"mhf" 'shen-show-function-documentation
"mhv" 'shen-show-variable-documentation))))

(defun shen/init-inf-shen ()
(use-package inf-shen
:defer t))