Questions tagged [ruby-mode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7
votes
2answers
737 views

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\...
5
votes
2answers
443 views

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 ...
4
votes
1answer
716 views

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 ...
3
votes
1answer
4k views

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) (...
3
votes
2answers
430 views

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 ...
3
votes
0answers
955 views

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 ...
2
votes
1answer
289 views

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.
2
votes
1answer
185 views

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::...
2
votes
1answer
513 views

Emacs indent with tabs to 2 columns

Current with C, Javascript, Ruby, etc. when inserting a block with { <RETURN>, Emacs automatically indents the next line, but it does so with spaces. How do I change this behavior to tab ...
2
votes
0answers
155 views

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 ...
1
vote
2answers
120 views

Navigating rspec files

Usually I use incremental searching to find what I'm looking for. Also, in general I write very small methods that easily fit in one screen. So before now I have had little use for any sort of code-...
1
vote
1answer
134 views

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:...
1
vote
1answer
39 views

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| ......
1
vote
1answer
166 views

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 ...
1
vote
1answer
318 views

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 ...
1
vote
1answer
197 views

How to hide heredoc block in ruby-mode?

In ruby-mode, using hs-minor-mode (hideshow) you can hide almost any block of code, but heredocs. I've tried adding "LONG_HEREDOC" to hs-special-modes-alist, but it didn't worked: (eval-after-load "...
1
vote
0answers
282 views

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 ...
0
votes
1answer
40 views

emacs ruby mode: can I reorder methods in file (alphabetical order)

After opening the file app/controllers/pages_controller.rb Which has class PagesController < ApplicationController def foo puts "foo" end def baa puts "baa" end end I ...
0
votes
2answers
400 views

how do you turn off smart brackets//parenthesis in prelude

I hate it when prelude auto adds the ending } when I type { (this is ruby mode) This is very common, for example typing ( auto adds a ) This is really annoying when trying to edit code, or a lot of ...
0
votes
1answer
208 views

Upgrading a built-in package

My system has emacs 24.5.1 with a built-in ruby-mode. I want to update to the latest ruby-mode from emacs 25.1 in order to get improved syntax highlighting. Upgrading the entire emacs installation is ...
0
votes
1answer
156 views

Vagrant Integration in rspec-mode

I have a vagrant machine for my Rails project. I would like to integrate Emacs with rspec, currently done by hand on a terminal (inside the vagrant machine). If I run rspec-verify-all Emacs will try ...
0
votes
0answers
11 views

How do I change my ruby mode syntax checker from ruby-rubocop to ruby-standard?

I see multiple options for Ruby when I run flycheck-select-checker and use autocomplete: ruby ruby-reek ruby-jruby ruby-rubocop ruby-rubylint ruby-standard ... I want to use ruby-standard, but if I ...
0
votes
1answer
35 views

how to properly install coverage mode?

What I did downloaded https://raw.githubusercontent.com/trezona-lecomte/coverage/master/coverage.el to load path ( ~/.emacs.d/lisp/ ) added to bottom of init.el: (use-package coverage :ensure t) ...
0
votes
0answers
20 views

Has anyone worked out configuring objed for ruby?

I am interested in trying out objed, but I find that out of the box it gets blocks and expressions wrong in ruby mode. For example, I notice that in identifying a defun it includes any comments and ...
0
votes
1answer
38 views

Autoloaded variable overrides the one from the init file

I added the following line to my init file to replace ruby-mode with enh-ruby-mode: (setq auto-mode-alist (mapcar (lambda (x) (if (eq (cdr x) 'ruby-mode) (cons (car ...
0
votes
0answers
280 views

Help with debugging emacs, when opening routes.rb from rails applications

I'm using emacs for my every day tasks, I started more or less 4 years ago, and now I'm very happy with emacs. maybe I have a lot of plugins working together. This is my-ruby configuration file I ...
0
votes
0answers
333 views

ruby-mode not indenting correctly?

I am using emacs 24.4 in -nw terminal mode. I know ruby-mode is included but I cannot get the following snippet to indent correctly in a .rb file. private def end Instead I can only get ...
-2
votes
2answers
118 views

Indispensable emacs modes for rails? [closed]

Are there definitive must-have modes when developing on rails, I usually get absorbed on the sea of different packages out there, is there some place that list them?