;;; 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 ;; URL: https://github.com/syl20bnr/spacemacs ;; ;; This file is not part of GNU Emacs. ;; ;;; License: GPLv3 (setq ruby-on-rails-packages '( feature-mode haml-mode projectile-rails slim-mode )) (defun ruby-on-rails/init-projectile-rails () (use-package projectile-rails :defer t :init (progn (add-hook 'enh-ruby-mode-hook 'projectile-rails-on)) :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)))) (defun ruby-on-rails/init-feature-mode () "Initialize Cucumber feature mode" (use-package feature-mode :mode (("\\.feature\\'" . feature-mode)))) (defun ruby-on-rails/init-haml-mode () (use-package haml-mode :defer t)) (defun ruby-on-rails/init-slim-mode () (use-package slim-mode :defer t))