Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add documentation for ruby_fold #118

Merged
merged 4 commits into from

3 participants

@rolfb

Added documentation for how to use the ruby_fold variable to enable folding if foldmethod is set to anything other than "syntax".

@rolfb rolfb Add documentation for ruby_fold
Added documentation for how to use the ruby_fold variable to enable folding if foldmethod is set to anything other than "syntax".
28b6498
@nelstrom

Looks good!

One minor issue: you've included the < to close the code block, but you omitted the opening >. See :help help-writing for details.

Also, it would be nice if you included *ruby_fold*, so as to generate a helptag for that setting, which would make this feature a bit more discoverable. Although I realize that the rest of this documentation doesn't use that convention.

@nelstrom

Typo fix: s/ruby-minlines/ruby_minlines

@rolfb

There you go :)

@AndrewRadev
Collaborator

Looks great. Thanks for your work :).

@AndrewRadev AndrewRadev merged commit 6d028f3 into from
@AndrewRadev
Collaborator

Hmm, actually, I'm going to have to edit it a bit. The ft-ruby-syntax file is included under Vim's :help syntax section, so putting separators makes it break conventions in that file. Still, the tags and numbering of sections might be a good idea, I'll just remove the separators for now.

@rolfb
@AndrewRadev
Collaborator

Well, I don't exactly know how it should look, I just noticed that it clashes a bit with what's in :help syntax :). I'm not the one who wrote the docs, so if maintainers with more knowledge of that area have an issue with it, please pitch in.

For now, I think the latest version I pushed is OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 30, 2012
  1. @rolfb

    Add documentation for ruby_fold

    rolfb authored
    Added documentation for how to use the ruby_fold variable to enable folding if foldmethod is set to anything other than "syntax".
  2. @rolfb

    Add missing ">"

    rolfb authored
  3. @rolfb
  4. @rolfb
This page is out of date. Refresh to see the latest.
Showing with 45 additions and 16 deletions.
  1. +45 −16 doc/ft-ruby-syntax.txt
View
61 doc/ft-ruby-syntax.txt
@@ -1,7 +1,50 @@
-RUBY *ruby.vim* *ft-ruby-syntax*
+RUBY *ruby.vim* *ft-ruby-syntax*
There are a number of options to the Ruby syntax highlighting.
+1. Ruby operators |ruby_operators|
+2. Whitespace errors |ruby_space_errors|
+3. Folds |ruby_fold|
+4. Reducing expensive operations |ruby_no_expensive| |ruby_minlines|
+
+
+==============================================================================
+1. Ruby operators *ruby_operators*
+
+Ruby operators can be highlighted.
+
+This is enabled by defining "ruby_operators": >
+
+ :let ruby_operators = 1
+<
+
+==============================================================================
+2. Whitespace errors *ruby_space_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.
+
+==============================================================================
+3. Folds *ruby_fold*
+
+Folds can be enabled by defining "ruby_fold": >
+
+ :let ruby_fold = 1
+<
+
+This will set the value |foldmethod| to "syntax" locally to the current buffer
+or window, which will enable syntax-based folding when editing Ruby filetypes.
+
+==============================================================================
+4. Reducing expensive operations *ruby_no_expensive*
+
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)
@@ -11,6 +54,7 @@ you may want to turn it off by defining the "ruby_no_expensive" variable: >
<
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: >
@@ -20,19 +64,4 @@ the "ruby_minlines" variable to a value larger than 50: >
Ideally, this value should be a number of lines large enough to embrace your
largest class or module.
-Ruby operators can be highlighted. This is enabled by defining
-"ruby_operators": >
-
- :let ruby_operators = 1
-<
-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.
-
-
vim:tw=78:sw=4:ts=8:ft=help:norl:
Something went wrong with that request. Please try again.