Skip to main content
Share Your Experience: Take the 2024 Developer Survey
6 votes
Accepted

How do I control how vim indents ruby blocks?

The file that controls this lives at /usr/share/vim/vim80/indent/ruby.vim. Opening the file, I see it has two variables: if !exists('g:ruby_indent_access_modifier_style') " Possible values: "normal"...
Martin Tournoij's user avatar
4 votes

Nested highlighting

Ok, this is probably not the best solution because it is pretty invasive. But, it's all I could come up with so I will give it to you. One thing we can do is basically manually do the highlighting ...
Tumbler41's user avatar
  • 7,756
3 votes

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

No, that is not possible. Vim treats all those 'is...' options as collections of characters (like [a-zA-z]), and cannot do more precise regular expression-like assertions. In fact, the 'iskeyword' ...
Ingo Karkat's user avatar
  • 17.9k
3 votes
Accepted

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

Just make sure your basic configuration has filetype enabled to begin with: filetype plugin on If it is, but sill not working as intended, you can set filetypes explicitly: Something like this ...
Mario G.'s user avatar
3 votes
Accepted

How to evaluate a ruby expression in a buffer

There are actually several way to do that. The first google result is the vim-ruby-eval plugin which provides the :RubyEval command. Here is a screen cast coming from the README page of the plugin: ...
statox's user avatar
  • 50.1k
3 votes

Vim omnicomplete with Ruby 2.3.1

Just solved my problem. Not 100% sure how, but I'll do my best to explain all the steps I took: Installed Vundle and configured it to manage vim-ruby and neocomplete, ran :PluginInstall and :...
brokenbyte's user avatar
2 votes
Accepted

Control indenting of Ruby Comments

Thanks to the comment's help, I was able to muck around with my .vimrc some more and isolate the issue to the commented-out line: filetype indent on Not sure how I missed that before, but it works ...
Mason's user avatar
  • 121
1 vote

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

The setting I was looking for is called coc_fileype_map(doc). To make solargraph lint and autofix rspec.ruby file types, the following setting had to be added to my vimrc: let g:coc_filetype_map = { ...
dimitry_n's user avatar
  • 121
1 vote

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

OK, I had packadd vim-rails in an ftplugin/ruby.vim file. Apparently this causes problems. Placing directly in ~/.vimrc file fixed the problem.
StevieD's user avatar
  • 1,492
1 vote
Accepted

neovim ruby/rails omnicomplete

From the error message you're getting, it seems your Vim doesn't have Ruby support compiled in. See this code snippet: if !has('ruby') call s:ErrMsg( "Error: Rubycomplete requires vim compiled ...
filbranden's user avatar
  • 29k
1 vote

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

I've finally uninstalled and then again installed tpope/vim-rails and also tpope/vim-projectionist. That fixed the problem. I've deleted question stackoverflow.com/q/60361162/9447571.
Citizen's user avatar
  • 31
1 vote

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

I have exactly the same problem. It seems that SpaceVim overrides the gf command in some way so that rails-vim plugin's gf doesn't check for _ on partial names anymore. Also, you have to be on the ...
Tim's user avatar
  • 11
1 vote
Accepted

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

ALE doesn't seem to support prettier for Ruby in its default configuration. Though it offers enough hooks for you to use a different executable (such as rbprettier) or to pass it additional arguments ...
filbranden's user avatar
  • 29k
1 vote
Accepted

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

It seems that if ruby path is not set correctly during vim compilation, it slows down vim when editing ruby files, check this post. Also, using old regex engine (set re=1) rather than the new one ...
Herz3h's user avatar
  • 126
1 vote
Accepted

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

It is probably the result of the mappings in $VIMRUNTIME/ftplugin/ruby.vim, which include a mapping of <C-R><C-W> to <Plug><cword> which is then mapped to a call to ...
garyjohn's user avatar
  • 6,349
1 vote

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

The iskeyword setting controls this. You can add ? and ! to it with: :setlocal iskeyword+=? iskeyword+=! Or, for just Ruby from your vimrc: augroup ruby_settings autocmd! autocmd Filetype ...
Martin Tournoij's user avatar
1 vote

Vim omnicomplete with Ruby 2.3.1

Are you using any kind of auto-completion plugin, like neocomplete/YouCompleteMe? I also use Arch Linux and for me it gives completions. I use neocomplete and vim-ruby plugins, that probably add ...
grodzik's user avatar
  • 4,638

Only top scored, non community-wiki answers of a minimum length are eligible