Add phoenix layer

- First remove elixir's layer project prefix, since it was used only for
  one binding which would be better suited in tests prefix
- Move `alchemist-project-find-test` to test prefix
- Add `phoenix` prefix and declare bindings
This commit is contained in:
Lyuben Petrov 2016-09-25 23:46:11 +03:00 committed by Codruț Constantin Gușoi
parent 616ca1443d
commit 86683ad558
7 changed files with 71 additions and 2 deletions

View file

@ -0,0 +1,29 @@
#+TITLE: phoenix layer
[[file:img/phoenix.png]] with [[file:img/alchemist.png]]
* Table of Contents :TOC_4_gh:noexport:
- [[#description][Description]]
- [[#install][Install]]
- [[#key-bindings][Key bindings]]
* Description
This layer adds keybindings for [[https://github.com/tonini/alchemist.el][Alchemist]]'s already built in phoenix mode.
* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =phoenix= to the existing =dotspacemacs-configuration-layers= list in this
file.
* Key bindings
| Key Binding | Description |
|---------------+--------------------|
| ~SPC m p r~ | Shows routes |
| ~SPC m p f w~ | Find in web folder |
| ~SPC m p f v~ | Find view |
| ~SPC m p f c~ | Find controller |
| ~SPC m p f C~ | Find channel |
| ~SPC m p f t~ | Find template |
| ~SPC m p f m~ | Find model |
| ~SPC m p f s~ | Find static |
| ~SPC m p f r~ | Find router |

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -0,0 +1,12 @@
;;; layers.el --- react Layer layers File for Spacemacs
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Lyuben Petrov <lyuben.y.petrov@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(configuration-layer/declare-layers '(elixir))

View file

@ -0,0 +1,28 @@
;;; packages.el --- phoenix layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Lyuben Petrov <lyuben.y.petrov@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst phoenix-packages
'(alchemist))
(defun phoenix/post-init-alchemist ()
(progn
(spacemacs/declare-prefix-for-mode 'elixir-mode "mp" "phoenix")
(spacemacs/declare-prefix-for-mode 'elixir-mode "mpf" "find")
(spacemacs/set-leader-keys-for-major-mode 'elixir-mode
"pfw" 'alchemist-phoenix-find-web
"pfv" 'alchemist-phoenix-find-views
"pfc" 'alchemist-phoenix-find-controllers
"pfC" 'alchemist-phoenix-find-channels
"pft" 'alchemist-phoenix-find-templates
"pfm" 'alchemist-phoenix-find-models
"pfs" 'alchemist-phoenix-find-static
"pfr" 'alchemist-phoenix-router
"pr" 'alchemist-phoenix-routes)))

View file

@ -149,7 +149,6 @@ You find and overview of all the key-bindings on the [[https://github.com/tonini
| Key Binding | Description |
|-------------+------------------------------------------------------------|
| ~SPC m p t~ | Open project test directory and list all test files. |
| ~SPC m g t~ | Toggle between a file and its tests in the current window. |
| ~SPC m g T~ | Toggle between a file and its tests in other window. |
@ -192,6 +191,7 @@ You find and overview of all the key-bindings on the [[https://github.com/tonini
| ~SPC m t N~ | Jump to previous test |
| ~SPC m t s~ | Run stale tests (~mix test --stale~) |
| ~SPC m t R~ | Toggle test report window |
| ~SPC m t F~ | Open project test directory and list all test files. |
** Compile

View file

@ -68,7 +68,6 @@
"ev" 'alchemist-eval-quoted-buffer
"eV" 'alchemist-eval-print-quoted-buffer
"pt" 'alchemist-project-find-test
"gt" 'alchemist-project-toggle-file-and-tests
"gT" 'alchemist-project-toggle-file-and-tests-other-window
@ -95,6 +94,7 @@
"tb" 'alchemist-mix-test-this-buffer
"tB" 'alchemist-project-run-tests-for-current-file
"tt" 'alchemist-mix-test-at-point
"tF" 'alchemist-project-find-test
"tf" 'alchemist-mix-test-file
"tn" 'alchemist-test-mode-jump-to-next-test
"tN" 'alchemist-test-mode-jump-to-previous-test