2015-07-04 03:33:13 +00:00
|
|
|
;;; packages.el --- Ruby on Rails Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2015-07-04 03:33:13 +00:00
|
|
|
;;
|
|
|
|
;; 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
|
2018-11-20 19:55:37 +00:00
|
|
|
'(
|
|
|
|
feature-mode
|
|
|
|
projectile-rails
|
|
|
|
which-key
|
|
|
|
))
|
2015-07-04 03:33:13 +00:00
|
|
|
|
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
|
|
|
|
:config
|
|
|
|
(progn
|
2017-02-11 10:19:04 +00:00
|
|
|
(projectile-rails-global-mode)
|
2015-07-04 03:33:13 +00:00
|
|
|
(spacemacs|diminish projectile-rails-mode " ⇋" " RoR")
|
|
|
|
|
|
|
|
;; Find files
|
2017-02-10 21:43:43 +00:00
|
|
|
(spacemacs/set-leader-keys-for-minor-mode 'projectile-rails-mode
|
2018-01-18 09:50:03 +00:00
|
|
|
"ffa" 'projectile-rails-find-locale
|
2018-07-18 07:48:44 +00:00
|
|
|
"ffb" 'projectile-rails-find-job
|
2018-01-18 09:50:03 +00:00
|
|
|
"ffc" 'projectile-rails-find-controller
|
|
|
|
"ffe" 'projectile-rails-find-environment
|
|
|
|
"fff" 'projectile-rails-find-feature
|
|
|
|
"ffh" 'projectile-rails-find-helper
|
|
|
|
"ffi" 'projectile-rails-find-initializer
|
|
|
|
"ffj" 'projectile-rails-find-javascript
|
|
|
|
"ffl" 'projectile-rails-find-lib
|
|
|
|
"ffm" 'projectile-rails-find-model
|
|
|
|
"ffn" 'projectile-rails-find-migration
|
|
|
|
"ffo" 'projectile-rails-find-log
|
|
|
|
"ffp" 'projectile-rails-find-spec
|
|
|
|
"ffr" 'projectile-rails-find-rake-task
|
|
|
|
"ffs" 'projectile-rails-find-stylesheet
|
|
|
|
"fft" 'projectile-rails-find-test
|
|
|
|
"ffu" 'projectile-rails-find-fixture
|
|
|
|
"ffv" 'projectile-rails-find-view
|
2018-07-18 07:48:44 +00:00
|
|
|
"ffw" 'projectile-rails-find-webpack
|
2018-01-18 09:50:03 +00:00
|
|
|
"ffy" 'projectile-rails-find-layout
|
|
|
|
"ff@" 'projectile-rails-find-mailer
|
|
|
|
;f Goto file
|
|
|
|
"fgc" 'projectile-rails-find-current-controller
|
|
|
|
"fgd" 'projectile-rails-goto-schema
|
|
|
|
"fge" 'projectile-rails-goto-seeds
|
|
|
|
"fgh" 'projectile-rails-find-current-helper
|
|
|
|
"fgj" 'projectile-rails-find-current-javascript
|
|
|
|
"fgg" 'projectile-rails-goto-gemfile
|
|
|
|
"fgm" 'projectile-rails-find-current-model
|
|
|
|
"fgn" 'projectile-rails-find-current-migration
|
|
|
|
"fgp" 'projectile-rails-find-current-spec
|
|
|
|
"fgr" 'projectile-rails-goto-routes
|
|
|
|
"fgs" 'projectile-rails-find-current-stylesheet
|
|
|
|
"fgt" 'projectile-rails-find-current-test
|
|
|
|
"fgu" 'projectile-rails-find-current-fixture
|
|
|
|
"fgv" 'projectile-rails-find-current-view
|
|
|
|
"fgz" 'projectile-rails-goto-spec-helper
|
|
|
|
"fg." 'projectile-rails-goto-file-at-point
|
2017-02-10 21:43:43 +00:00
|
|
|
;; Rails external commands
|
2018-01-18 09:50:03 +00:00
|
|
|
"f:" 'projectile-rails-rake
|
|
|
|
"fcc" 'projectile-rails-generate
|
2018-07-18 07:48:44 +00:00
|
|
|
"fcd" 'projectile-rails-destroy
|
2018-01-18 09:50:03 +00:00
|
|
|
"fi" 'projectile-rails-console
|
|
|
|
"fxs" 'projectile-rails-server
|
2017-02-10 21:43:43 +00:00
|
|
|
;; Refactoring 'projectile-rails-mode
|
2018-01-18 09:50:03 +00:00
|
|
|
"fRx" 'projectile-rails-extract-region)
|
|
|
|
|
|
|
|
(dolist (mode '(ruby-mode enh-ruby-mode))
|
2019-02-11 16:10:05 +00:00
|
|
|
(spacemacs/declare-prefix-for-mode mode "mf" "rails")
|
|
|
|
(spacemacs/declare-prefix-for-mode mode "mfc" "generate/destroy")
|
|
|
|
(spacemacs/declare-prefix-for-mode mode "mfR" "extract")
|
|
|
|
(spacemacs/declare-prefix-for-mode mode "mfx" "server")
|
2018-01-18 09:50:03 +00:00
|
|
|
(spacemacs/declare-prefix-for-mode mode "mff" "file")
|
|
|
|
(spacemacs/declare-prefix-for-mode mode "mfg" "goto"))
|
2016-08-02 08:34:17 +00:00
|
|
|
|
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))))
|
2016-08-02 08:34:17 +00:00
|
|
|
|
|
|
|
(defun ruby-on-rails/post-init-which-key ()
|
2016-11-22 18:34:22 +00:00
|
|
|
(push '((nil . "projectile-rails-\\(.+\\)") . (nil . "\\1"))
|
|
|
|
which-key-replacement-alist))
|