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 phoenix layer #7192

Closed
wants to merge 2 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions layers/+frameworks/phoenix/README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#+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 f r~ | Shows routes |
| ~SPC m f f w~ | Find in web folder |
| ~SPC m f f v~ | Find view |
| ~SPC m f f c~ | Find controller |
| ~SPC m f f C~ | Find channel |
| ~SPC m f f t~ | Find template |
| ~SPC m f f m~ | Find model |
| ~SPC m f f s~ | Find static |
| ~SPC m f f r~ | Find router |
Binary file added layers/+frameworks/phoenix/img/alchemist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added layers/+frameworks/phoenix/img/phoenix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions layers/+frameworks/phoenix/layers.el
Original file line number Diff line number Diff line change
@@ -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))
28 changes: 28 additions & 0 deletions layers/+frameworks/phoenix/packages.el
Original file line number Diff line number Diff line change
@@ -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 "mf" "phoenix")
(spacemacs/declare-prefix-for-mode 'elixir-mode "mff" "find")
(spacemacs/set-leader-keys-for-major-mode 'elixir-mode
"ffw" 'alchemist-phoenix-find-web
"ffv" 'alchemist-phoenix-find-views
"ffc" 'alchemist-phoenix-find-controllers
"ffC" 'alchemist-phoenix-find-channels
"fft" 'alchemist-phoenix-find-templates
"ffm" 'alchemist-phoenix-find-models
"ffs" 'alchemist-phoenix-find-static
"ffr" 'alchemist-phoenix-router
"fr" 'alchemist-phoenix-routes)))
2 changes: 1 addition & 1 deletion layers/+lang/elixir/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,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. |

Expand Down Expand Up @@ -191,6 +190,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

Expand Down
2 changes: 1 addition & 1 deletion layers/+lang/elixir/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down