summaryrefslogtreecommitdiff
path: root/mms-prog-ruby.org
blob: 18908a1bd0457b717ab1f1b8d8df3d8ee333517f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#+TITLE: Michał Sapka's Emacs Config - Prog mode - Ruby
#+AUTHOR: Michał Sapka (https://michal.sapka.me)
#+STARTUP: showall indent logdoneGeneral settings

#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/
#+HUGO_WEIGHT: 400 
#+HUGO_SECTION: emacs/config
#+HUGO_CATEGORIES: emacs emacs-config
#+HUGO_MENU :menu "emacs-config" :name "Ruby"
#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - Ruby"
#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "My Ruby language setup"
#+EXPORT_FILE_NAME: ruby

* Intro

I am a Ruby developer by trade (and still /heart), but I am no longer a code 

* Irb

Inf-Ruby allows for interactive REPL inside Emacs.
You can create a buffer with IRB, you can send code there and you can run =babel= code blocks in ruby.
Cool!

#+begin_src emacs-lisp
  (use-package inf-ruby
  :ensure t)
#+end_src

* Robe

Yes, we have LSP but they work /poorly/ in my experience.
Robe is a major mode designed to work with Ruby so let's ride it.

#+begin_src emacs-lisp
  (use-package robe
  :ensure t)
#+end_src

And I want it to be enable whenever I am /doing ruby./
#+begin_src emacs-lisp
  (add-hook 'ruby-mode-hook 'robe-mode)
  (add-hook 'ruby-ts-mode-hook 'robe-mode)
#+end_src

Let's also add it to autocomplete (for the future, as I have yet to setup company)
#+begin_src emacs-lisp
  (eval-after-load 'company
    '(push 'company-robe company-backends))
#+end_src