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
|
2015-10-15 20:52:43 +00:00
|
|
|
(dolist (mode '(ruby-mode enh-ruby-mode))
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode mode
|
|
|
|
"rfa" 'projectile-rails-find-locale
|
|
|
|
"rfc" 'projectile-rails-find-controller
|
|
|
|
"rfe" 'projectile-rails-find-environment
|
|
|
|
"rff" 'projectile-rails-find-feature
|
|
|
|
"rfh" 'projectile-rails-find-helper
|
|
|
|
"rfi" 'projectile-rails-find-initializer
|
|
|
|
"rfj" 'projectile-rails-find-javascript
|
|
|
|
"rfl" 'projectile-rails-find-lib
|
|
|
|
"rfm" 'projectile-rails-find-model
|
|
|
|
"rfn" 'projectile-rails-find-migration
|
|
|
|
"rfo" 'projectile-rails-find-log
|
|
|
|
"rfp" 'projectile-rails-find-spec
|
|
|
|
"rfr" 'projectile-rails-find-rake-task
|
|
|
|
"rfs" 'projectile-rails-find-stylesheet
|
|
|
|
"rft" 'projectile-rails-find-test
|
|
|
|
"rfu" 'projectile-rails-find-fixture
|
|
|
|
"rfv" 'projectile-rails-find-view
|
|
|
|
"rfy" 'projectile-rails-find-layout
|
|
|
|
"rf@" 'projectile-rails-find-mailer
|
2015-10-15 20:52:43 +00:00
|
|
|
;; Goto file
|
2015-11-18 00:38:05 +00:00
|
|
|
"rgc" 'projectile-rails-find-current-controller
|
|
|
|
"rgd" 'projectile-rails-goto-schema
|
|
|
|
"rge" 'projectile-rails-goto-seeds
|
|
|
|
"rgh" 'projectile-rails-find-current-helper
|
|
|
|
"rgj" 'projectile-rails-find-current-javascript
|
|
|
|
"rgg" 'projectile-rails-goto-gemfile
|
|
|
|
"rgm" 'projectile-rails-find-current-model
|
|
|
|
"rgn" 'projectile-rails-find-current-migration
|
|
|
|
"rgp" 'projectile-rails-find-current-spec
|
|
|
|
"rgr" 'projectile-rails-goto-routes
|
|
|
|
"rgs" 'projectile-rails-find-current-stylesheet
|
|
|
|
"rgt" 'projectile-rails-find-current-test
|
|
|
|
"rgu" 'projectile-rails-find-current-fixture
|
|
|
|
"rgv" 'projectile-rails-find-current-view
|
|
|
|
"rgz" 'projectile-rails-goto-spec-helper
|
|
|
|
"rg." 'projectile-rails-goto-file-at-point
|
2015-10-15 20:52:43 +00:00
|
|
|
;; Rails external commands
|
2015-11-27 04:56:21 +00:00
|
|
|
"r:" 'projectile-rails-rake
|
2015-11-18 00:38:05 +00:00
|
|
|
"rcc" 'projectile-rails-generate
|
|
|
|
"ri" 'projectile-rails-console
|
|
|
|
"rxs" 'projectile-rails-server
|
2015-10-15 20:52:43 +00:00
|
|
|
;; Refactoring 'projectile-rails-mode
|
2015-11-18 00:38:05 +00:00
|
|
|
"rRx" 'projectile-rails-extract-region))
|
2015-07-04 03:33:13 +00:00
|
|
|
;; 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))))
|