;; init-ruby.el --- Initialize ruby configurations. -*- lexical-binding: t -*- ;; Copyright (C) 2010-2022 Vincent Zhang ;; Author: Vincent Zhang ;; URL: https://github.com/seagle0128/.emacs.d ;; This file is not part of GNU Emacs. ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as ;; published by the Free Software Foundation; either version 3, or ;; (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth ;; Floor, Boston, MA 02110-1301, USA. ;; ;;; Commentary: ;; ;; Ruby configurations. ;; ;;; Code: ;; Integrate rbenv (use-package rbenv :straight t :ensure t :defer t :hook (after-init . global-rbenv-mode) :init (setq rbenv-show-active-ruby-in-modeline nil)) ;; YAML mode (use-package yaml-mode :straight t :ensure t :defer t) ;; Run a Ruby process in a buffer (use-package inf-ruby :straight t :ensure t :defer t :hook ((ruby-mode . inf-ruby-minor-mode) (compilation-filter . inf-ruby-auto-enter))) ;; Ruby YARD comments (use-package yard-mode :straight t :ensure t :defer t :diminish :hook (ruby-mode . yard-mode)) ;; Ruby refactoring helpers (use-package ruby-refactor :straight t :ensure t :defer t :diminish :hook (ruby-mode . ruby-refactor-mode-launch)) ;; Yet Another RI interface for Emacs (use-package yari :straight t :ensure t :defer t :bind (:map ruby-mode-map ([f1] . yari))) ;; RSpec (use-package rspec-mode :straight t :ensure t :defer t :diminish :autoload rspec-install-snippets :hook (dired-mode . rspec-dired-mode) :config (with-eval-after-load 'yasnippet (rspec-install-snippets))) (provide 'init-ruby) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; init-ruby.el ends here