FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
vim-ruby/doc/ft-ruby-syntax.txt at master · chmodawk/vim-ruby · GitHub
chmodawk
/
vim-ruby
Public
forked from
vim-ruby/vim-ruby
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
vim-ruby
/
doc
/
ft-ruby-syntax.txt
Copy path
More file actions
More file actions
Latest commit
History
History
History
119 lines (93 loc) · 3.78 KB
Breadcrumbs
vim-ruby
/
doc
/
ft-ruby-syntax.txt
Copy path
File metadata and controls
119 lines (93 loc) · 3.78 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
RUBY
*ruby.vim*
*ft-ruby-syntax*
*vim-ruby-syntax*
Ruby: Operator highlighting
|
ruby_operators
|
Ruby: Whitespace errors
|
ruby_space_errors
|
Ruby: Syntax errors
|
ruby_syntax_errors
|
Ruby: Folding
|
ruby_fold
|
|
ruby_foldable_groups
|
Ruby: Reducing expensive operations
|
ruby_no_expensive
|
|
ruby_minlines
|
Ruby: Spellchecking strings
|
ruby_spellcheck_strings
|
*ruby_operators*
Ruby: Operator highlighting
~
Operators, and pseudo operators, can be highlighted by defining:
>
:let ruby_operators = 1
:let ruby_pseudo_operators = 1
<
The supported pseudo operators are ., &., ::, *, **, &, <, << and ->.
*ruby_space_errors*
Ruby: Whitespace errors
~
Whitespace errors can be highlighted by defining "ruby_space_errors":
>
:let ruby_space_errors = 1
<
This will highlight trailing whitespace and tabs preceded by a space character
as errors. This can be refined by defining "ruby_no_trail_space_error" and
"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after
spaces respectively.
*ruby_syntax_errors*
Ruby: Syntax errors
~
Redundant line continuations and predefined global variable look-alikes (such
as $# and $-z) can be highlighted as errors by defining:
>
:let ruby_line_continuation_error = 1
:let ruby_global_variable_error = 1
<
*ruby_fold*
Ruby: Folding
~
Folding can be enabled by defining "ruby_fold":
>
:let ruby_fold = 1
<
This will set the value of
'foldmethod'
to "syntax" locally to the current
buffer or window, which will enable syntax-based folding when editing Ruby
filetypes.
*ruby_foldable_groups*
Default folding is rather detailed, i.e., small syntax units like "if", "do",
"%w[]" may create corresponding fold levels.
You can set "ruby_foldable_groups" to restrict which groups are foldable:
>
:let ruby_foldable_groups = 'if case %'
<
The value is a space-separated list of keywords:
keyword meaning
~
-------- -------------------------------------
~
ALL Most block syntax (default)
NONE Nothing
if "if" or "unless" block
def "def" block
class "class" block
module "module" block
do "do" block
begin "begin" block
case "case" block
for "for", "while", "until" loops
{ Curly bracket block or hash literal
[ Array literal
% Literal with "%" notation, e.g.: %w(STRING), %!STRING!
/ Regexp
string String and shell command output (surrounded by ', ", `)
: Symbol
# Multiline comment
<< Here documents
__END__ Source code after "__END__" directive
NONE and ALL have priority, in that order, over all other folding groups.
*ruby_no_expensive*
Ruby: Reducing expensive operations
~
By default, the "end" keyword is colorized according to the opening statement
of the block it closes. While useful, this feature can be expensive; if you
experience slow redrawing (or you are on a terminal with poor color support)
you may want to turn it off by defining the "ruby_no_expensive" variable:
>
:let ruby_no_expensive = 1
<
In this case the same color will be used for all control keywords.
*ruby_minlines*
If you do want this feature enabled, but notice highlighting errors while
scrolling backwards, which are fixed when redrawing with
CTRL-L
, try setting
the "ruby_minlines" variable to a value larger than 50:
>
:let ruby_minlines = 100
<
Ideally, this value should be a number of lines large enough to embrace your
largest class or module.
*ruby_spellcheck_strings*
Ruby: Spellchecking strings
~
Ruby syntax will perform spellchecking of strings if you define
"ruby_spellcheck_strings":
>
:let ruby_spellcheck_strings = 1
<
vim:tw=78:sw=4:ts=8:ft=help:norl:
Back
|
FazBrowse Home
|
New Git URL