Skip to main content

Questions tagged [ruby-mode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
46 views

flycheck mode ruby/chef checker - foodcritic vs. cookstyle

I use standard ubuntu emacs (27.1) with flycheck mode from melpa (reinstalled today). Chef/Cinc is a ruby based Infrastructure as Code language. Flycheck mode has been working very well with these ....
Nicolai Langfeldt's user avatar
0 votes
2 answers
46 views

Emacs ruby-mode how to prevent narrowed buffer from widening when manual save is triggered

I just discovered narrowing in Emacs, and it's great to be able to focus on a single function or block of code. However, after I narrow with C-x n n, make some changes and then save manually with C-x ...
may's user avatar
  • 125
0 votes
1 answer
58 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) ...
american-ninja-warrior's user avatar
0 votes
0 answers
29 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 ...
Daniel Doherty's user avatar
0 votes
1 answer
96 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 ...
x-yuri's user avatar
  • 291
1 vote
1 answer
239 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:...
x-yuri's user avatar
  • 291
5 votes
1 answer
990 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 ...
Gernot's user avatar
  • 151
2 votes
1 answer
377 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 ...
Nickolay Kolev's user avatar
0 votes
1 answer
68 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 ...
american-ninja-warrior's user avatar
2 votes
1 answer
512 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.
american-ninja-warrior's user avatar
1 vote
1 answer
51 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| ......
tamouse's user avatar
  • 135
2 votes
0 answers
189 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 ...
Maciej Szlosarczyk's user avatar
5 votes
1 answer
1k 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 ...
american-ninja-warrior's user avatar
0 votes
2 answers
639 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 ...
american-ninja-warrior's user avatar
0 votes
0 answers
323 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 ...
anquegi's user avatar
  • 749
0 votes
1 answer
384 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 ...
ScottJ's user avatar
  • 101
1 vote
1 answer
342 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 ...
Jamie Schembri's user avatar
0 votes
0 answers
362 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 ...
Adam Thompson's user avatar
3 votes
2 answers
485 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 ...
harumph's user avatar
  • 33
1 vote
2 answers
196 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-...
Hut8's user avatar
  • 678
0 votes
1 answer
168 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 ...
licorna's user avatar
  • 207
5 votes
2 answers
502 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 ...
Kukunin's user avatar
  • 151
2 votes
1 answer
233 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::...
waymondo's user avatar
  • 1,394
1 vote
1 answer
248 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 "...
Murmansk Manny's user avatar
6 votes
1 answer
5k 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) (...
yujaiyu's user avatar
  • 896
2 votes
1 answer
659 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 ...
user avatar
7 votes
2 answers
831 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\...
Renan Ranelli's user avatar
-2 votes
2 answers
129 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?
Rash_Pro's user avatar
3 votes
0 answers
1k 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 ...
vyusfire's user avatar