Questions tagged [filetype-ruby]

The tag has no usage guidance.

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

How can I align chained methods in Ruby files?

I often use = to indent lines but my configuration doesn't fit my needs. Is there an option that indent lines like this: 'vim rocks'.capitalize .concat(' !') Instead of this: 'vim rocks'....
user avatar
  • 101
1 vote
1 answer
777 views

Configuring coc.nvim coc-solargraph with standardrb for RSpec files

I am trying to configure coc.nvim for my vim 8.2. I mapped my formatting to leader-d with: nnoremap <Leader>d :call CocAction('format') <CR> which works fine for ruby filetype. However, ...
user avatar
  • 121
1 vote
0 answers
26 views

Can't redefine tabstop, softtabstop and softwidth after syntax detection

I've a vim: VIM - Vi IMproved 8.2 (2019 Dec 12, собрано Apr 8 2020 14:10:43) and I tried to redefine tabstop, softtabstop and softwidth values for a file after detection of its syntax. I.e. I have a ...
user avatar
0 votes
1 answer
177 views

:Ctags command returns "E492: Not an editor command: Ctags" error

I have vim-rails plugin installed (it's definitely installed as evidenced by good output from :echo rails#app(). I have ctags installed with: brew install --with-jansson --HEAD universal-ctags/...
user avatar
  • 1,257
1 vote
1 answer
654 views

neovim ruby/rails omnicomplete

I'm trying to get omnicomplete working in neovim (0.3.4) on debian 10 with Ruby 2.6.6 (rbenv). I have these plugins: Plug 'vim-ruby/vim-ruby' " ruby ...
user avatar
  • 113
2 votes
1 answer
36 views

Rails Vim tab completition for model and controller works different than for views

I'm using Vim with Rails Vim plugin. When trying to tab-complete command :Emodel U or :Econtroller U and then <Tab> it won't recognize the user.rb or user_controller.rb file. But works fine for :...
user avatar
  • 31
2 votes
3 answers
298 views

How to get tpope/vim-rails gf command to work with SpaceVim

I am using SpaceVim as Ruby on Rails IDE and installed the tpope/vim-rails plugin. Commands such as :Econtroller, :Emodel and :find are working just fine, but the gf command provided by this plugin ...
user avatar
2 votes
1 answer
796 views

How do I configure the parameters that ALE sends to prettier for ruby?

Note: this is a neovim question, not stock vim I have both rbprettier and prettier with the ruby plugin installed on my system. If I pipe a Ruby file into rbprettier, or if I pipe it into prettier --...
user avatar
2 votes
0 answers
449 views

Omni completion Pattern not found - Error loading rails environment

I'm trying to make Omni completion work with my Ruby files, but it only works with Ruby's core libraries; for instance, after typing String.<C-X><C-O> i get all Ruby's String methods, ...
user avatar
  • 121
0 votes
1 answer
686 views

sheerun/vim-polyglot ruby seems cause enormous slow down, how to fix or better plugin to use?

When I open a ruby based file (.rb,.erb) in nvim, it causes my whole laptop to slow down! This seems to be caused by sheerun/vim-polyglot that I use for syntax highlighting, specifically the ruby ...
user avatar
  • 229
3 votes
0 answers
462 views

Neovim takes so long to source ruby.vim [closed]

After noticing some lag that only happens when I use neovim to open Ruby files, I have debugged it and find the result quite interesting (from ms 255 to ms 1294): times in msec clock self+sourced ...
user avatar
  • 131
3 votes
1 answer
9k views

Why files in `~/.config/nvim/after/ftplugin/` are not taken into acount?

My neovim doesn't load file type plugins when loading a ruby/eruby file. Here is the corresponding configuration files: for f in ~/.config/nvim/after/ftplugin/* ; do echo "# $f" ; cat $f; done # /...
user avatar
0 votes
1 answer
544 views

Inconsistent <cword>, <C-R><C-W>, and keyword behavior

I'm in a Ruby file, and because ! is not an iskeyword character, if I place the cursor on a call to mymethod! and attempt a tag lookup via C - ], Vim searches for mymethod (without the !). Adding ! to ...
user avatar
  • 1,200
2 votes
1 answer
400 views

ruby syntax highlighting lost on long files

With a "long" ruby file (896 lines in my case) the ruby syntax highlighting is lost when I G to the bottom of the file. Once that happens and I go back to the top with gg, the syntax highlighting ...
user avatar
  • 203
0 votes
1 answer
468 views

Ruby indentation: align multiline method chains on the leading dot?

Vim indents Ruby multiline method-chains like: object.read .write .rithmetic I'd like to make it align the dots instead: object.read .write .rithmetic I haven't been able to find a ...
user avatar
  • 1,200
0 votes
1 answer
128 views

Does vim have functionality for completetion of methods/variables with punctuation?

In Ruby, and languages based on Ruby the style-guide recommends bool getter methods be named empty? as opposed to is_empty. Note the question mark. Vim however, does not complete the ? by default. Is ...
user avatar
  • 171
5 votes
1 answer
148 views

Possible to use `!` in `iskeyword`, but only at the end of a word?

I regularly use Vim to write Ruby code, which allows ! as part of method identifiers and also uses it as logical negation. Currently, I configure iskeyword to include ! (using autocmd Filetype ruby ...
user avatar
  • 151
3 votes
1 answer
467 views

How do I control how vim indents ruby blocks?

When I start a ruby block in the middle of a line, the next line is indented deeper than I'd like. It's indented from the start of the block, not the start of the line. Example: some_variable_name =...
user avatar
  • 133
0 votes
1 answer
171 views

Control indenting of Ruby Comments

I use Vim to edit Ruby code, and the one issue that I keep having trouble with is the comment indenting. It seems that Vim really wants all # comment marks that begin a line to indent all the way to ...
user avatar
  • 121
0 votes
1 answer
164 views

How to evaluate a ruby expression in a buffer

I believe that I once saw a plugin which allowed one to see the result of evaluating ruby expressions inside a buffer. Eg, if I wrote a line like 3 + 2 # => and pressed the required magic keys, ...
user avatar
  • 2,281
3 votes
2 answers
2k views

Vim omnicomplete with Ruby 2.3.1

I've recently learned about Vim's omnicompletion and while attempting to make it work, I get the error Pattern not found. To test it I used the following code: class C def hello puts "Hello, ...
user avatar
3 votes
1 answer
678 views

Nested highlighting

In html eruby files, I would like to highlight the <% ... %> text in dark green only when it is inside double quotes. I.e. in in this example: I want it dark green instead of white. I know ...
user avatar
2 votes
0 answers
289 views

Enhancing Vim gf command for ruby: include module syntax

I am looking for a way to enhance vim gf command class Myclass include Mymodules::HardToFind end I have started with installing tpope/rails-vim: Easy navigation of the Rails directory structure....
user avatar
  • 153
4 votes
0 answers
778 views

How to enable autocomplete for my rails functions

How can I add auto-complete for my Rails project? I want autocomplete for existing rails functions, including gems, and for functions I created. I hope there is some plugin for smart auto-complete, ...
user avatar
  • 141
2 votes
3 answers
157 views

Plugin for on-the-fly # => evaluation

How can I evaluate Ruby code on-the-fly when you are writing it? This is what it looks like: 5 + 5 # => 10
user avatar
  • 2,252