Questions tagged [ruby-mode]

29 questions
7
votes
2 answers

Do not align nested calls when using ruby-smie

When using the newly added ruby formatting functionality I face the following problem: I would really like for my rspec code to be formatted like the following: it do is_expected.to match(/\[Error\]/) .and match(/#{result}/) .and…
Renan Ranelli
  • 1,379
  • 10
  • 17
5
votes
1 answer

Symbol's value as variable is void: company-backends

I'm trying to setup robe for Rails development. It needs company mode and I have some issues with it: Have following in init.el: ;; robe, documentation lookup and completion for Ruby (require 'robe) (add-hook 'ruby-mode-hook 'robe-mode) (add-to-list…
foki
  • 886
  • 8
  • 22
5
votes
2 answers

Include vendor's tags for ruby-mode and ggtags

I'm trying to install and configure the ggtags package. Primarily, I use it for a ruby on rails projects (enh-ruby-mode). I can generate ctags including all vendor's files for my project with the following command: ctags -R --languages=ruby…
Kukunin
  • 151
  • 1
4
votes
1 answer

Using emacs for ruby development with asdf version manager

I have installed a (doom) emacs to start developing with Ruby. So far I have mainly used Sublime Text but because of reasons I want to give emacs a chance. I tried Spacemacs too but uninstalled this because it was really slow) A problem I have now…
Gernot
  • 141
  • 3
4
votes
1 answer

how do you fold/unfold complex ruby code blocks

I found a snippet that let's me fold bad(large) blocks of code (add-hook 'ruby-mode-hook (lambda () (hs-minor-mode))) (eval-after-load "hideshow" '(add-to-list 'hs-special-modes-alist `(ruby-mode ,(rx (or "def"…
american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40
3
votes
0 answers

Why doesn't auto-complete work in ruby-mode?

I have spent several days trying to debug auto-complete, it is working properly in Elisp mode, but when I go in Ruby mode it stops working. auto-complete-mode runs successfully, but the menu of candidates does not appear when I type the word or…
3
votes
2 answers

Division sometimes breaks syntax highlighting in ruby-mode

Interesting bug in ruby-mode. When a variable called index is followed by a slash /, syntax highlighting breaks. Here's a screenshot to show you what I mean: I'm not really sure how to file a ticket on the ruby-mode repo since I've never used SVN.…
harumph
  • 33
  • 2
2
votes
1 answer

Emacs indent with tabs to 2 columns

Current with C, Javascript, Ruby, etc. when inserting a block with { , Emacs automatically indents the next line, but it does so with spaces. How do I change this behavior to tab characters? The follow is my configuration. (setq-default…
Vortico
2
votes
1 answer

Modifying ruby-mode indentation

Currently, ruby-mode in Emacs 27 indents the following snippets like this: expect(foo).to match( bar ) expect(foo).to \ match(bar) Is there a way to have them indented like this, to avoid overly long…
2
votes
1 answer

jump to ruby symbol with emacs

In a ruby project. when point is at a ruby symbol, for example UserCart::PromotionService.new(blah blah how can I jump to the definition of that class/module.
american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40
2
votes
0 answers

Inconsistent hash indentation in ruby-mode

I've noticed that indent-region behaves this way in ruby-mode: { down_payment: 40.00, payment_day: 10 } { "down_payment": 40.00, "payment_day": 10 } Both are valid Ruby hashes, so in principle they should behave the same…
2
votes
1 answer

Use hippie-expand to complete ruby symbols without prefix

I am an avid hippie-expand user but I find it annoying that it natively doesn't complete ruby symbols without the prefix. For example (cursor is |): class ApplicationController < ActionController::Base before_action :some_action protected …
waymondo
  • 1,384
  • 11
  • 16
1
vote
1 answer

How do I make emacs indent relative to the beginning of the previous line?

Here's how emacs indents e.g. Python code: a = myfun(b, c) I'd like it to be this way: a = myfun(b, c) Reasoning? If I later replace myfun with myfunction, in the first case it becomes: a = myfunction(b, c) I can probably…
x-yuri
  • 281
  • 1
  • 8
1
vote
1 answer

Indentation incorrect in line with `if:` or `unless:` as options, not directives

In some of my ruby files, mostly Rails Model files, I often encounter lines such as: validates :thing_id, presence: { message: '^Choose a Thing' }, on: :create, unless: Proc.new { |obj| ... some condition ... } Where the unless: is…
tamouse
  • 135
  • 4
1
vote
1 answer

comint-mode + vagrant

Disclaimer: Pretty new to Emacs and running Spacemacs, have no idea what I'm doing with elisp. We run all our projects under vagrant, so I'm interested in getting some things, such as inf-ruby-mode consoles, to ssh into my vagrant box before running…
1
2