Skip to content

Commit 947cfcc

Browse files
committed
Split and reformat documentation
Improve formatting consistency suitable for upstream distribution.
1 parent c1b3eea commit 947cfcc

5 files changed

Lines changed: 177 additions & 172 deletions

File tree

doc/ft-ruby-indent.txt

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
RUBY *ft-ruby-indent*
2+
3+
Ruby: Access modifier indentation |ruby-access-modifier-indentation|
4+
Ruby: Block style indentation |ruby-block-style-indentation|
5+
Ruby: Assignment style indentation |ruby-assignment-style-indentation|
6+
7+
*ruby-access-modifier-indentation*
8+
*g:ruby_indent_access_modifier_style*
9+
Ruby: Access modifier indentation ~
10+
11+
Different access modifier indentation styles can be used by setting: >
12+
13+
:let g:ruby_indent_access_modifier_style = 'normal'
14+
:let g:ruby_indent_access_modifier_style = 'indent'
15+
:let g:ruby_indent_access_modifier_style = 'outdent'
16+
<
17+
By default, the "normal" access modifier style is used.
18+
19+
Access modifier style "normal":
20+
>
21+
class Indent
22+
private :method
23+
protected :method
24+
private
25+
def method; end
26+
protected
27+
def method; end
28+
public
29+
def method; end
30+
end
31+
<
32+
Access modifier style "indent":
33+
>
34+
class Indent
35+
private :method
36+
protected :method
37+
private
38+
def method; end
39+
protected
40+
def method; end
41+
public
42+
def method; end
43+
end
44+
<
45+
Access modifier style "outdent":
46+
>
47+
class Indent
48+
private :method
49+
protected :method
50+
private
51+
def method; end
52+
protected
53+
def method; end
54+
public
55+
def method; end
56+
end
57+
<
58+
*ruby-block-style-indentation*
59+
*g:ruby_indent_block_style*
60+
Ruby: Block style indentation ~
61+
62+
Different block indentation styles can be used by setting: >
63+
64+
:let g:ruby_indent_block_style = 'expression'
65+
:let g:ruby_indent_block_style = 'do'
66+
<
67+
By default, the "expression" block indent style is used.
68+
69+
Block indent style "expression":
70+
>
71+
first
72+
.second do |x|
73+
something
74+
end
75+
<
76+
Block indent style "do":
77+
>
78+
first
79+
.second do |x|
80+
something
81+
end
82+
<
83+
84+
*ruby-assignment-style-indentation*
85+
*g:ruby_indent_assignment_style*
86+
Ruby: Assignment style indentation ~
87+
88+
Different styles of indenting assignment for multiline expressions:
89+
>
90+
:let g:ruby_indent_assignment_style = 'hanging'
91+
:let g:ruby_indent_assignment_style = 'variable'
92+
<
93+
By default, the "hanging" style is used.
94+
95+
Assignment indent style "hanging":
96+
>
97+
x = if condition
98+
something
99+
end
100+
<
101+
Assignment indent style "variable":
102+
>
103+
x = if condition
104+
something
105+
end
106+
<
107+
108+
109+
vim:tw=78:sw=4:ts=8:ft=help:norl:

doc/ft-ruby-omni.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
RUBY *ft-ruby-omni*
1+
RUBY *ft-ruby-omni*
22

33
Completion of Ruby code requires that Vim be built with |+ruby|.
44

@@ -21,22 +21,22 @@ The completions provided by CTRL-X CTRL-O are sensitive to the context:
2121

2222
Notes:
2323
- Vim will load/evaluate code in order to provide completions. This may
24-
cause some code execution, which may be a concern. This is no longer
24+
cause some code execution, which may be a concern. This is no longer
2525
enabled by default, to enable this feature add >
2626
let g:rubycomplete_buffer_loading = 1
2727
<- In context 1 above, Vim can parse the entire buffer to add a list of
28-
classes to the completion results. This feature is turned off by default,
28+
classes to the completion results. This feature is turned off by default,
2929
to enable it add >
3030
let g:rubycomplete_classes_in_global = 1
3131
< to your vimrc
3232
- In context 2 above, anonymous classes are not supported.
3333
- In context 3 above, Vim will attempt to determine the methods supported by
3434
the object.
3535
- Vim can detect and load the Rails environment for files within a rails
36-
project. The feature is disabled by default, to enable it add >
36+
project. The feature is disabled by default, to enable it add >
3737
let g:rubycomplete_rails = 1
3838
< to your vimrc
39-
- Vim can parse a Gemfile, in case gems are being implicitly required. To
39+
- Vim can parse a Gemfile, in case gems are being implicitly required. To
4040
activate the feature: >
4141
let g:rubycomplete_load_gemfile = 1
4242
< To specify an alternative path, use: >

doc/ft-ruby-plugin.txt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
RUBY *ft-ruby-plugin*
2+
3+
Ruby: Motion commands |ruby-motion|
4+
Ruby: Text objects |ruby-text-objects|
5+
6+
*ruby-motion*
7+
Ruby: Motion commands ~
8+
9+
Vim provides motions such as |[m| and |]m| for jumping to the start or end of
10+
a method definition. Out of the box, these work for curly-bracket languages,
11+
but not for Ruby. The vim-ruby plugin enhances these motions, by making them
12+
also work on Ruby files.
13+
14+
*ruby-]m*
15+
]m Go to start of next method definition.
16+
17+
*ruby-]M*
18+
]M Go to end of next method definition.
19+
20+
*ruby-[m*
21+
[m Go to start of previous method definition.
22+
23+
*ruby-[M*
24+
[M Go to end of previous method definition.
25+
26+
*ruby-]]*
27+
]] Go to start of next module or class definition.
28+
29+
*ruby-][*
30+
][ Go to end of next module or class definition.
31+
32+
*ruby-[[*
33+
[[ Go to start of previous module or class definition.
34+
35+
*ruby-[]*
36+
[] Go to end of previous module or class definition.
37+
38+
*ruby-text-objects*
39+
Ruby: Text objects ~
40+
41+
Vim's |text-objects| can be used to select or operate upon regions of text
42+
that are defined by structure. The vim-ruby plugin adds text objects for
43+
operating on methods and classes.
44+
45+
*ruby-v_am* *ruby-am*
46+
am "a method", select from "def" until matching "end"
47+
keyword.
48+
49+
*ruby-v_im* *ruby-im*
50+
im "inner method", select contents of "def"/"end" block,
51+
excluding the "def" and "end" themselves.
52+
53+
*ruby-v_aM* *ruby-aM*
54+
aM "a class", select from "class" until matching "end"
55+
keyword.
56+
57+
*ruby-v_iM* *ruby-iM*
58+
iM "inner class", select contents of "class"/"end"
59+
block, excluding the "class" and "end" themselves.
60+
61+
62+
vim:tw=78:sw=4:ts=8:ft=help:norl:

doc/ft-ruby-syntax.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ as errors. This can be refined by defining "ruby_no_trail_space_error" and
2525
"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after
2626
spaces respectively.
2727

28-
*ruby_fold*
28+
*ruby_fold*
2929
Ruby: Folding ~
3030

3131
Folding can be enabled by defining "ruby_fold": >

doc/vim-ruby.txt

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)