tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.1k stars 383 forks source link

vim-rails overrides makeprg value #535

Closed itsNikolay closed 5 years ago

itsNikolay commented 5 years ago

Issue

vim-rails overrides makeprg value

Steps to reproduce:

  1. .vimrc:
    comp rails
    set makeprg=bin/rspec " I expect rspec
  2. in vim:
    :set makeprg
    makeprg=bin/rails  " I get rails

    Evironment

    vim-rails version: cb188c6b73d490d3e9b2e3ada044e208aabdc647 vim version:

    VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 25 2019 16:45:07)
    macOS version
    Included patches: 1-982
tpope commented 5 years ago

Use autocmd User Rails ... to override the compiler.

martinos commented 4 years ago

I am not sure I understand.

In this case should we do :

autocmd User Rails makeprg=bin/rspec

?

tpope commented 4 years ago
autocmd User Rails compiler rspec
ylecuyer commented 1 year ago

For future reference, looks like the event is now called BufEnterRails https://github.com/tpope/vim-rails/blob/959e94b76e6ebdf984acef61649ba7d0f62bd425/plugin/rails.vim#L111

So it is: autocmd User BufEnterRails compiler rspec

tpope commented 1 year ago

The event wasn't renamed; that's a different event.