You've configured company-mode to load after your init file is evaluated using the after-init-hook, but are then trying to modify company-backends right away.
That variable isn't defined until company-mode is loaded. You either need to just require company, or defer setting that variable using eval-after-load:
I tried yafolding, seems to work (theres room for improvement on this, though)
(add-hook 'ruby-mode-hook 'yafolding-mode)
(global-set-key (kbd "M-RET") 'yafolding-toggle-element)
"yafolding", "hideshow", "folding.el", "imenu.el","vimish-fold"
Here's a ...
In short, it is because Ruby's syntax is ambiguous, and because String#index accepts a regexp in its first argument.
There are different tradeoffs different editors take regarding regular expressions in Ruby. We can discuss improving Emacs's tradeoff in a bug report.
The Ruby editing mode defines ruby-indent-tabs-mode and sets indent-tabs-mode to that value when the mode is invoked. The default for this is nil. To fix your problem, set this variable instead.
This seems like a bug to me. There's no reason Ruby needs its own special setting for this.
Note also that c-basic-offset doesn't affect Ruby. Ruby has ruby-...
@Dmitry made a great point that hippie-expand will do what I'm desiring when : is considered a punctuation character.
It's obviously not ideal to just set (modify-syntax-entry ?: "." ruby-mode-syntax-table) in your init and call it a day, because then only some_action in :some_action is considered a symbol which would break expectations for other plugins. ...
This solution doesn't address code folding, but does aim to address the issue of navigation and code context awareness.
imenu allows navigation of source files in all languages, including Ruby. But rspec doesn't support it out of the box. You can add support for imenu to rspec files with rspec mode (it's in melpa).
imenu by itself is OK, but I highly ...
Found the answer in a youtube
Specifically as a prelude user, what I did was
kill emacs daemon
;; add to personal.el
place cursor at contant/sumbol
And sure ...
You might want to stick to the defaults, since:
r = my_long_function_name(
is arguably preferable over:
r = my_long_function_name(param1,
But if you care (Emacs 26.3), for Python:
The problem with both of these is ruby-mode tries to be consistent and apply similar indentation rules to similar syntax constructs.
We try to support the popular indentation approach for paren-less method calls:
class Book < ActiveRecord::Base
Marking the region and calling M-x sort-paragraphs RET should do it
sort-paragraphs is an interactive autoloaded compiled Lisp function in
(sort-paragraphs REVERSE BEG END)
Sort paragraphs in region alphabetically; argument means descending order.
Called from a program, there are three arguments:
REVERSE (non-nil means reverse order), BEG and ...
Use bookmarks to identify and return to such positions.
If you use Bookmark+ then you can easily create and use autonamed or temporary (i.e., non-persistent) bookmarks, and these can be automatically highlighted in various ways (e.g., fringe marker or position or line), if you want.
Just hit C-x p RET to create an autonamed bookmark -- no need to provide a ...
Ah, I've answered a different question. I somehow managed to completely ignore the ~/ in (load "~/ruby-mode").
I've now edited that out of the paths I've used below, in order that what I've written is coherent. It might still be useful info, so I'll not delete it, but it's not what you were asking...
Emacs looks for libraries in the directories specified ...
I use next function to run rails console on remote host.
It seems that run-ruby doesn't care how REPL is started, so I pass it an ssh command. Most important part is the command itself:
-t for pseudo-terminal mode, without it repl won't work;
bash --login to get usual shell (for rbenv, rvm or other stuff that initialised on shell startup). If you use zsh, ...
Here's how to use global installed from a Ubuntu repository. The version I've had in 6.6.3-2.
First, copy the example config to your home directory. A commentary at its top makes it seem like this is unnecessary, but that's not true. The default config it has is much different, and doesn't recognize .rb files at all, AFAICT.