Skip to content

Commit 672bb65

Browse files
committed
Document :R-free commands
1 parent e24e864 commit 672bb65

File tree

1 file changed

+89
-88
lines changed

1 file changed

+89
-88
lines changed

doc/rails.txt

Lines changed: 89 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,8 @@ actually edit a file from a Rails application.
5656
is active for the current buffer, also show the type
5757
of Rails file detected.
5858

59-
*rails-:Rcd*
60-
:Rcd [{directory}] |:cd| to /path/to/railsapp/{directory}.
61-
62-
*rails-:Rlcd*
63-
:Rlcd [{directory}] |:lcd| to /path/to/railsapp/{directory}.
64-
6559
*rails-:Redit*
66-
:Redit {file} Obsolete alias for |:R|.
60+
:Redit {file} Obsolete alias for |:R| or |:A|.
6761

6862
*rails-:Rfind*
6963
:Rfind [{file}] Obsolete alias for |:find|.
@@ -105,12 +99,6 @@ actually edit a file from a Rails application.
10599
:Rpreview! [{path}] Like :Rpreview, but open the path inside Vim using
106100
|netrw| instead.
107101

108-
*rails-:Rtags*
109-
:Rtags Calls ctags -R on the current application root.
110-
Exuberant ctags must be installed. Additional
111-
arguments can be passed to ctags with
112-
|g:rails_ctags_arguments|.
113-
114102
*rails-:Rrefresh*
115103
:Rrefresh Refreshes certain cached settings. Most noticeably,
116104
this clears the cached list of classes that are syntax
@@ -119,6 +107,18 @@ actually edit a file from a Rails application.
119107
*rails-:Rrefresh!*
120108
:Rrefresh! As above, and also reloads rails.vim.
121109

110+
*rails-:Cd* *rails-:Rcd*
111+
:Cd [{directory}] |:cd| to /path/to/railsapp/{directory}.
112+
113+
*rails-:Lcd* *rails-:Rlcd*
114+
:Lcd [{directory}] |:lcd| to /path/to/railsapp/{directory}.
115+
116+
*rails-:Ctags* *rails-:Rtags*
117+
:Ctags Calls ctags -R on the current application root.
118+
Exuberant ctags must be installed. Additional
119+
arguments can be passed to ctags with
120+
|g:rails_ctags_arguments|.
121+
122122
NAVIGATION *rails-navigation*
123123

124124
Navigation is where the real power of this plugin lies. Efficient use of the
@@ -227,134 +227,135 @@ controller name.
227227

228228
Each of the following commands has variants for splitting, vertical splitting,
229229
opening in a new tab, and reading the file into the current buffer. For
230-
:Rmodel, those variants would be :RSmodel, :RVmodel, :RTmodel, and :RDmodel.
231-
There is also :REmodel which is a synonym for :Rmodel (future versions might
232-
allow customization of the behavior of :Rmodel). They also allow for jumping
233-
to methods or line numbers using the same syntax as |:R|, and file creation
234-
(with a bit of boilerplate) can be forced by adding a ! after the filename
235-
(not after the command itself!).
236-
237-
:Rcontroller |rails-:Rcontroller|
238-
:Renvironment |rails-:Renvironment|
239-
:Rfixtures |rails-:Rfixtures|
240-
:Rfunctionaltest |rails-:Rfunctionaltest|
241-
:Rhelper |rails-:Rhelper|
242-
:Rinitializer |rails-:Rinitializer|
243-
:Rintegrationtest |rails-:Rintegrationtest|
244-
:Rjavascript |rails-:Rjavascript|
245-
:Rlayout |rails-:Rlayout|
246-
:Rlib |rails-:Rlib|
247-
:Rlocale |rails-:Rlocale|
248-
:Rmailer |rails-:Rmailer|
249-
:Rmigration |rails-:Rmigration|
250-
:Rmodel |rails-:Rmodel|
251-
:Rschema |rails-:Rschema|
252-
:Rspec |rails-:Rspec|
253-
:Rstylesheet |rails-:Rstylesheet|
254-
:Rtask |rails-:Rtask|
255-
:Runittest |rails-:Runittest|
256-
:Rview |rails-:Rview|
257-
258-
*rails-:Rcontroller*
259-
:Rcontroller [{name}] Edit the specified or current controller.
260-
261-
*rails-:Renvironment*
262-
:Renvironment [{name}] Edit the config/environments file specified. With no
230+
:Emodel, those variants would be :Smodel, :Vmodel, :Tmodel, and :Dmodel.
231+
They also allow for jumping to methods or line numbers using the same syntax
232+
as |:R|, and file creation (with a bit of boilerplate) can be forced by adding
233+
a ! after the filename (not after the command itself!).
234+
235+
There are also "classic" versions of these commands that start with :R (e.g.,
236+
:Rmodel, :RSmodel, :RVmodel, :RTmodel, and :RDmodel).
237+
238+
:Econtroller |rails-:Econtroller|
239+
:Eenvironment |rails-:Eenvironment|
240+
:Efixtures |rails-:Efixtures|
241+
:Efunctionaltest |rails-:Efunctionaltest|
242+
:Ehelper |rails-:Ehelper|
243+
:Einitializer |rails-:Einitializer|
244+
:Eintegrationtest |rails-:Eintegrationtest|
245+
:Ejavascript |rails-:Ejavascript|
246+
:Elayout |rails-:Elayout|
247+
:Elib |rails-:Elib|
248+
:Elocale |rails-:Elocale|
249+
:Emailer |rails-:Emailer|
250+
:Emigration |rails-:Emigration|
251+
:Emodel |rails-:Emodel|
252+
:Eschema |rails-:Eschema|
253+
:Espec |rails-:Espec|
254+
:Estylesheet |rails-:Estylesheet|
255+
:Etask |rails-:Etask|
256+
:Eunittest |rails-:Eunittest|
257+
:Eview |rails-:Eview|
258+
259+
*rails-:Econtroller* *rails-:Rcontroller*
260+
:Econtroller [{name}] Edit the specified or current controller.
261+
262+
*rails-:Eenvironment* *rails-:Renvironment*
263+
:Eenvironment [{name}] Edit the config/environments file specified. With no
263264
argument, defaults to editing config/application.rb
264265
or config/environment.rb.
265266

266-
*rails-:Rfixtures*
267-
:Rfixtures [{name}] Edit the fixtures for the given or current model. If
267+
*rails-:Efixtures* *rails-:Rfixtures*
268+
:Efixtures [{name}] Edit the fixtures for the given or current model. If
268269
an argument is given, it must be pluralized, like the
269270
final filename (this may change in the future). If
270271
omitted, the current model is pluralized. An optional
271272
extension can be given, to distinguish between YAML
272273
and CSV fixtures.
273274

274-
*rails-:Rfunctionaltest*
275-
:Rfunctionaltest [{name}]
275+
*rails-:Efunctionaltest* *rails-:Rfunctionaltest*
276+
:Efunctionaltest [{name}]
276277
Edit the functional test or controller spec for the
277278
specified or current controller.
278279

279-
*rails-:Rhelper*
280-
:Rhelper [{name}] Edit the helper for the specified name or current
280+
*rails-:Ehelper* *rails-:Rhelper*
281+
:Ehelper [{name}] Edit the helper for the specified name or current
281282
controller.
282283

283-
*rails-:Rinitializer*
284-
:Rinitializer [{name}] Edit the config/initializers file specified. With no
284+
*rails-:Einitializer* *rails-:Rinitializer*
285+
:Einitializer [{name}] Edit the config/initializers file specified. With no
285286
argument, defaults to editing config/routes.rb.
286287

287-
*rails-:Rintegrationtest*
288-
:Rintegrationtest [{name}]
288+
*rails-:Eintegrationtest* *rails-:Rintegrationtest*
289+
:Eintegrationtest [{name}]
289290
Edit the integration test, integration spec, or
290291
cucumber feature specified. With no argument,
291292
defaults to editing test/test_helper.rb.
292293

293-
*rails-:Rjavascript*
294-
:Rjavascript [{name}] Edit the JavaScript for the specified name or current
294+
*rails-:Ejavascript* *rails-:Rjavascript*
295+
:Ejavascript [{name}] Edit the JavaScript for the specified name or current
295296
controller. Also supports CoffeeScript in
296297
app/scripts/.
297298

298-
*rails-:Rlayout*
299-
:Rlayout [{name}] Edit the specified layout. Defaults to the layout for
299+
*rails-:Elayout* *rails-:Rlayout*
300+
:Elayout [{name}] Edit the specified layout. Defaults to the layout for
300301
the current controller, or the application layout if
301302
that cannot be found. A new layout will be created if
302303
an extension is given.
303304

304-
*rails-:Rlib*
305-
:Rlib [{name}] Edit the library from the lib directory for the
305+
*rails-:Elib* *rails-:Rlib*
306+
:Elib [{name}] Edit the library from the lib directory for the
306307
specified name. With no argument, defaults to editing
307308
the application Gemfile (a task formally handled by
308309
the defunct :Rplugin).
309310

310-
*rails-:Rlocale*
311-
:Rlocale [{name}] Edit the config/locale file specified, optionally
311+
*rails-:Elocale* *rails-:Rlocale*
312+
:Elocale [{name}] Edit the config/locale file specified, optionally
312313
adding a yml or rb extension if none is given. With
313314
no argument, checks config/environment.rb for the
314315
default locale.
315316

316-
*rails-:Rmailer*
317-
:Rmailer [{name}] Edit the mailer specified. This looks in both
317+
*rails-:Emailer* *rails-:Rmailer*
318+
:Emailer [{name}] Edit the mailer specified. This looks in both
318319
app/mailers for Rails 3 and app/models for older
319320
versions of Rails but only tab completes the former.
320321

321-
*rails-:Rmigration*
322-
:Rmigration [{pattern}] If {pattern} is a number, find the migration for that
322+
*rails-:Emigration* *rails-:Rmigration*
323+
:Emigration [{pattern}] If {pattern} is a number, find the migration for that
323324
particular set of digits, zero-padding if necessary.
324325
Otherwise, find the newest migration containing the
325326
given pattern. Omitting the pattern selects the
326327
latest migration. Give a numeric argument of 0 to edit
327328
db/seeds.rb.
328329

329-
*rails-:Rmodel*
330-
:Rmodel [{name}] Edit the specified or current model.
330+
*rails-:Emodel* *rails-:Rmodel*
331+
:Emodel [{name}] Edit the specified or current model.
331332

332-
*rails-:Rspec*
333-
:Rspec [{name}] Edit the given spec. With no argument, defaults to
333+
*rails-:Espec* *rails-:Rspec*
334+
:Espec [{name}] Edit the given spec. With no argument, defaults to
334335
editing spec/spec_helper.rb (If you want to jump to
335336
the spec for the given file, use |:A| instead). This
336337
command is only defined if there is a spec folder in
337338
the root of the application.
338339

339-
*rails-:Rschema*
340-
:Rschema [{table}] Edit the schema and optionally jump to the specified
340+
*rails-:Eschema* *rails-:Rschema*
341+
:Eschema [{table}] Edit the schema and optionally jump to the specified
341342
table.
342343

343-
*rails-:Rstylesheet*
344-
:Rstylesheet [{name}] Edit the stylesheet for the specified name or current
344+
*rails-:Estylesheet* *rails-:Rstylesheet*
345+
:Estylesheet [{name}] Edit the stylesheet for the specified name or current
345346
controller. Also supports Sass and SCSS.
346347

347-
*rails-:Rtask*
348-
:Rtask [{name}] Edit the .rake file from lib/tasks for the specified
348+
*rails-:Etask* *rails-:Rtask*
349+
:Etask [{name}] Edit the .rake file from lib/tasks for the specified
349350
name. If no argument is given, the application
350351
Rakefile is edited.
351352

352-
*rails-:Runittest*
353-
:Runittest [{name}] Edit the unit test or model spec for the specified
353+
*rails-:Eunittest* *rails-:Runittest*
354+
:Eunittest [{name}] Edit the unit test or model spec for the specified
354355
name or current model.
355356

356-
*rails-:Rview*
357-
:Rview [[{controller}/]{view}]
357+
*rails-:Eview* *rails-:Rview*
358+
:Eview [[{controller}/]{view}]
358359
Edit the specified view. The controller will default
359360
sensibly, and the view name can be omitted when
360361
editing a method of a controller. If a view name is
@@ -615,9 +616,9 @@ detected, so all navigation commands should work as expected inside a spec
615616
file. :Rake in a spec runs just that spec, and in a model, controller, or
616617
helper, runs the associated spec.
617618

618-
|:Runittest| and |:Rfunctionaltest| lead double lives, handling model/helper
619+
|:Eunittest| and |:Efunctionaltest| lead double lives, handling model/helper
619620
and controller/mailer specs respectively. For view specs, you can use
620-
|:Rspec|, or define your own navigation commands:
621+
|:Espec|, or define your own navigation commands:
621622
>
622623
Rnavcommand specview spec/views -glob=**/* -suffix=_spec.rb
623624
<
@@ -824,7 +825,7 @@ The full list of available options is as follows:
824825
multiple projections to combine them into a single command. Glob
825826
keys are used when the command is given an argument, and literal file
826827
keys are used when no argument is given. See the "features/support"
827-
entries above for an example :Rsupport that defaults to env.
828+
entries above for an example :Esupport that defaults to env.
828829
*rails-projection-affinity*
829830
"affinity" ~
830831
Provide this if the root of your file name corresponds to either
@@ -838,7 +839,7 @@ The full list of available options is as follows:
838839
*rails-projection-template*
839840
"template" ~
840841
If you provide a ! after the argument to the navigation command (that
841-
is, :Ruploader foo!, NOT :Ruploader! foo), and a new file is created,
842+
is, :Euploader foo!, NOT :Euploader! foo), and a new file is created,
842843
this will be used as the body.
843844

844845
CONFIGURATION *rails-configuration*
@@ -851,7 +852,7 @@ configuration.
851852
If you would like to set your own custom Vim settings whenever a Rails file is
852853
loaded, you can use an autocommand like the following in your vimrc: >
853854
854-
autocmd User Rails silent! Rlcd
855+
autocmd User Rails silent! Lcd
855856
autocmd User Rails map <buffer> <F9> :Rake<CR>
856857
857858
There used to be autocommands that fire based on the "type" or file name of
@@ -884,7 +885,7 @@ This variable was formerly used to globally disable abbreviations. Use
884885
g:rails_no_abbreviations if you want to do that.
885886

886887
*g:rails_ctags_arguments*
887-
Additional arguments to pass to ctags from |:Rtags|. Defaults to ignoring
888+
Additional arguments to pass to ctags from |:Ctags|. Defaults to ignoring
888889
JavaScript files, since ctags has a tendency to choke on those.
889890
>
890891
let g:rails_ctags_arguments = ['--languages=-javascript']

0 commit comments

Comments
 (0)