@@ -878,21 +878,14 @@ respective sections. You can also put projections in
878878 *rails-:autocmd* *rails-autocommands*
879879If you would like to set your own custom Vim settings whenever a Rails file is
880880loaded, you can use an autocommand like the following in your vimrc: >
881+
881882 autocmd User Rails silent! Rlcd
882883 autocmd User Rails map <buffer> <F9> :Rake<CR>
883- You can also have autocommands that only apply to certain types of files.
884- These are based off the information shown when running the | :Rails! |
885- command, with hyphens changed to periods. A few examples: >
886- autocmd User Rails.controller* iabbr <buffer> wsn wsdl_service_name
887- autocmd User Rails.model.arb* iabbr <buffer> vfo validates_format_of
888- autocmd User Rails.view.erb* imap <buffer> <C-Z> <%= %><C-O>3h
889- End all such Rails autocommands with asterisks, even if you have an exact
890- specification, to allow for more specific subtypes to be added in the future.
891- There is also a filename matching syntax: >
892- autocmd User Rails/config/environment.rb Rabbrev c config
893- autocmd User Rails/**/foo_bar.rb Rabbrev FB:: FooBar
894- Use the filetype based syntax whenever possible, reserving the filename based
895- syntax for more advanced cases.
884+
885+ There used to be autocommands that fire based on the "type" or file name of
886+ the buffer, but they have been removed. If you still need to execute code for
887+ certain file types only, use the bare User Rails event above and check
888+ rails#buffer().relative() for the path relative to the Rails root.
896889
897890 *macros/rails.vim*
898891If you have several commands to run on initialization for all file types, they
0 commit comments