GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #272 from bootleq/foldable · vim-ruby/vim-ruby@c9f5523

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc
    • ft-ruby-syntax.txt
  • etc/examples/generators
    • syntax.rb
  • syntax
    • ruby.vim
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/ft-ruby-syntax.txt‎

Copy file name to clipboardExpand all lines: doc/ft-ruby-syntax.txt
+36-2Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ There are a number of options to the Ruby syntax highlighting.
55
1. Ruby operators |ruby_operators|
66
2. Whitespace errors |ruby_space_errors|
77
3. Folds |ruby_fold|
8-
4. Reducing expensive operations |ruby_no_expensive| |ruby_minlines|
8+
4. Foldable groups |ruby_foldable_groups|
9+
5. Reducing expensive operations |ruby_no_expensive| |ruby_minlines|
910

1011

1112
1. Ruby operators *ruby_operators*
@@ -39,7 +40,40 @@ Folds can be enabled by defining "ruby_fold": >
3940
This will set the value |foldmethod| to "syntax" locally to the current buffer
4041
or window, which will enable syntax-based folding when editing Ruby filetypes.
4142

42-
4. Reducing expensive operations *ruby_no_expensive*
43+
4. Foldable groups *ruby_foldable_groups*
44+
45+
Default folding is rather detailed, i.e., small syntax units like "if", "do",
46+
"%w[]" may create corresponding fold levels.
47+
48+
You can set "ruby_foldable_groups" to restrict which groups are foldable: >
49+
50+
:let ruby_foldable_groups = 'if case %'
51+
<
52+
value is space-separated keywords, known keywords were:
53+
54+
keyword meaning ~
55+
-------- ------------------------------------- ~
56+
ALL Most block syntax (default)
57+
NONE Nothing
58+
if "if" or "unless" block
59+
def "def" block
60+
class "class" block
61+
module "module" block
62+
do "do" block
63+
begin "begin" block
64+
case "case" block
65+
for "for", "while", "until" loops
66+
{ Curly bracket block or hash literal
67+
[ Array literal
68+
% Literal with "%" notation, e.g.: %w(STRING), %!STRING!
69+
/ Regexp
70+
string String and shell command output (surrounded by ', ", `)
71+
: Symbol
72+
# Multiline comment
73+
<< Here documents
74+
__END__ Source code after "__END__" directive
75+
76+
5. Reducing expensive operations *ruby_no_expensive*
4377

4478
By default, the "end" keyword is colorized according to the opening statement
4579
of the block it closes. While useful, this feature can be expensive; if you

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.