2015-07-04 03:33:13 +00:00
|
|
|
;;; packages.el --- Ruby on Rails 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
|
|
|
|
|
2015-07-06 07:32:22 +00:00
|
|
|
(setq ruby-on-rails-packages
|
2015-07-04 03:33:13 +00:00
|
|
|
'(
|
|
|
|
feature-mode
|
|
|
|
projectile-rails
|
|
|
|
))
|
|
|
|
|
2015-07-06 07:32:22 +00:00
|
|
|
(defun ruby-on-rails/init-projectile-rails ()
|
2015-07-04 03:33:13 +00:00
|
|
|
(use-package projectile-rails
|
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(progn
|
2015-07-21 02:37:00 +00:00
|
|
|
(add-hook 'projectile-mode-hook 'projectile-rails-on))
|
2015-07-04 03:33:13 +00:00
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(spacemacs|diminish projectile-rails-mode " ⇋" " RoR")
|
|
|
|
|
|
|
|
;; Find files
|
|
|
|
(evil-leader/set-key-for-mode 'enh-ruby-mode
|
|
|
|
"mrfa" 'projectile-rails-find-locale
|
|
|
|
"mrfc" 'projectile-rails-find-controller
|
|
|
|
"mrfe" 'projectile-rails-find-environment
|
|
|
|
"mrff" 'projectile-rails-find-feature
|
|
|
|
"mrfh" 'projectile-rails-find-helper
|
|
|
|
"mrfi" 'projectile-rails-find-initializer
|
|
|
|
"mrfj" 'projectile-rails-find-javascript
|
|
|
|
"mrfl" 'projectile-rails-find-lib
|
|
|
|
"mrfm" 'projectile-rails-find-model
|
|
|
|
"mrfn" 'projectile-rails-find-migration
|
|
|
|
"mrfo" 'projectile-rails-find-log
|
|
|
|
"mrfp" 'projectile-rails-find-spec
|
|
|
|
"mrfr" 'projectile-rails-find-rake-task
|
|
|
|
"mrfs" 'projectile-rails-find-stylesheet
|
|
|
|
"mrft" 'projectile-rails-find-test
|
|
|
|
"mrfu" 'projectile-rails-find-fixture
|
|
|
|
"mrfv" 'projectile-rails-find-view
|
|
|
|
"mrfy" 'projectile-rails-find-layout
|
|
|
|
"mrf@" 'projectile-rails-find-mailer
|
|
|
|
;; Goto file
|
|
|
|
"mrgc" 'projectile-rails-find-current-controller
|
|
|
|
"mrgd" 'projectile-rails-goto-schema
|
|
|
|
"mrge" 'projectile-rails-goto-seeds
|
|
|
|
"mrgh" 'projectile-rails-find-current-helper
|
|
|
|
"mrgj" 'projectile-rails-find-current-javascript
|
|
|
|
"mrgg" 'projectile-rails-goto-gemfile
|
|
|
|
"mrgm" 'projectile-rails-find-current-model
|
|
|
|
"mrgn" 'projectile-rails-find-current-migration
|
|
|
|
"mrgp" 'projectile-rails-find-current-spec
|
|
|
|
"mrgr" 'projectile-rails-goto-routes
|
|
|
|
"mrgs" 'projectile-rails-find-current-stylesheet
|
|
|
|
"mrgt" 'projectile-rails-find-current-test
|
|
|
|
"mrgu" 'projectile-rails-find-current-fixture
|
|
|
|
"mrgv" 'projectile-rails-find-current-view
|
|
|
|
"mrgz" 'projectile-rails-goto-spec-helper
|
|
|
|
"mrg." 'projectile-rails-goto-file-at-point
|
|
|
|
;; Rails external commands
|
|
|
|
"mrcc" 'projectile-rails-generate
|
|
|
|
"mri" 'projectile-rails-console
|
|
|
|
"mrr:" 'projectile-rails-rake
|
|
|
|
"mrxs" 'projectile-rails-server
|
|
|
|
;; Refactoring 'projectile-rails-mode
|
|
|
|
"mrRx" 'projectile-rails-extract-region)
|
|
|
|
;; Ex-commands
|
|
|
|
(evil-ex-define-cmd "A" 'projectile-toggle-between-implementation-and-test))))
|
|
|
|
|
2015-07-06 07:32:22 +00:00
|
|
|
(defun ruby-on-rails/init-feature-mode ()
|
2015-07-04 03:33:13 +00:00
|
|
|
"Initialize Cucumber feature mode"
|
|
|
|
(use-package feature-mode
|
|
|
|
:mode (("\\.feature\\'" . feature-mode))))
|