Table of Contents

emberjs layer

Table of ContentsClose


1. Description

This enables helpers for working with Ember.js projects.

This also includes ember-yasnippets. See the README for ember-yansippets for the snippet keys.

To use this, you need to add add a .dir-locals.el file with the following in the root of your ember project:

((nil . ((mode . ember))))

If you do not wish to do the following, you may also just do M-x ember-mode, however it will make things easier.

Additionally, temporary backup, autosave, and lockfiles interfere with broccoli watcher, so they need to either be moved out of the way or disabled.

Add the following to your dotspacemacs/user-config:

(setq backup-directory-alist `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))
(setq create-lockfiles nil)

1.1. Features:

  • Ability to easily switch between various files
  • Key bindings for generators and also easily revert generator actions
  • Ability to build, start server, and run tests

2. Install

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

(setq-default dotspacemacs-configuration-layers '(emberjs))

3. Completion System

By default this will use ido, but it may be configured to use helm by adding the following in your dotspacemacs/user-config function:

(setq ember-completion-system 'helm)

4. Key bindings

4.1. File key bindings

Key binding Description
SPC m f f c ember-open-controller
SPC m f f m ember-open-model
SPC m f f o ember-open-router
SPC m f f p ember-open-component
SPC m f f r ember-open-route
SPC m f f j ember-open-javascript
SPC m f f t ember-open-template
SPC m f f x ember-open-mixin
SPC m f f i ember-open-initializer
SPC m f f u ember-open-util
SPC m f f s ember-open-service

4.2. Generator key bindings

Key binding Description
SPC m f g c ember-generate-controller
SPC m f g m ember-generate-model
SPC m f g o ember-generate-router
SPC m f g p ember-generate-component
SPC m f g r ember-generate-route
SPC m f g j ember-generate-javascript
SPC m f g t ember-generate-template
SPC m f g x ember-generate-mixin
SPC m f g i ember-generate-initializer
SPC m f g u ember-generate-util
SPC m f g s ember-generate-service
SPC m f g g ember-generate

4.3. Destroy (the inverse of generate) key bindings

Key binding Description
SPC m f d c ember-destroy-controller
SPC m f d m ember-destroy-model
SPC m f d o ember-destroy-router
SPC m f d p ember-destroy-component
SPC m f d r ember-destroy-route
SPC m f d j ember-destroy-javascript
SPC m f d t ember-destroy-template
SPC m f d x ember-destroy-mixin
SPC m f d i ember-destroy-initializer
SPC m f d u ember-destroy-util
SPC m f d s ember-destroy-service
SPC m f d d ember-destroy

4.4. Key bindings to build, start the server and run tests

Key binding Description
SPC m f r b ember-build
SPC m f r s ember-serve-or-display
SPC m f r t ember-test

Author: root

Created: 2024-06-14 Fri 18:50