- Notifications
You must be signed in to change notification settings - Fork1
jlcrochet/vim-ruby
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is intended to be a drop-in replacement forvim-ruby. I wrote it because the original vim-ruby is known for having many accuracy and performance issues related to syntax highlighting and indentation. After perusing the code for the original plugin, I decided that a complete rewrite was necessary.
In addition to regular Ruby files, this plugin also supports editing ERB and HAML files. If you want support for Ruby Signature files, check out myvim-rbs plugin.
This is a standard Vim plugin which can be installed using your plugin manager of choice. If you do not already have a plugin manager, I recommendvim-plug.
- Type: boolean
- Default:
0
The default indentation style used by this plugin is the one most commonly found in the Ruby community, which allows for "hanging" or "floating" indentation. Some examples:
x=ify5else10endx=beginh["foo"]rescueKeyError"Not Found"endx=caseywhen:foo5when:bar10else1endx=[:foo,:bar,:baz,:qux]x=5 +10 +15 +20 -5 *3x=y.foo.bar.baz
For those who prefer a more traditional indentation style or who desire slightly faster highlighting and indentation, setg:ruby_simple_indent to1. The above examples will now be indented thus:
x=ify5else10endx=beginh["foo"]rescueKeyError"Not Found"endx=caseywhen:foo5when:bar10else1endx=[:foo,:bar,:baz,:qux]# ORx=[:foo,:bar,:baz,:qux]x=5 +10 +15 +20 -5 *3# ORx=5 +10 +15 +20 -5 *3x=y.foo.bar.baz# ORx=y.foo.bar.baz
The following variables enable syntax highlighting and indentation for code inside of HAML filters.
NOTE: These variables cause syntax files for other file types to be loaded, which may increase load times or degrade performance; additionally, the code in said files were not necessarily written by the author of this plugin and are thus not guaranteed to work well with this plugin.
- Type: boolean
- Default:
1
Enables highlighting and indentation for code inside of:css filters.
- Type: boolean
- Default:
0
Enables highlighting and indentation for code inside of:erb filters.
- Type: boolean
- Default:
1
Enables highlighting and indentation for code inside of:javascript filters.
- Type: boolean
- Default:
0
Enables highlighting and indentation for code inside of:less filters.
- Type: boolean
- Default:
0
Enables highlighting and indentation for code inside of:markdown filters.
- Type: boolean
- Default:
1
Enables highlighting and indentation for code inside of:ruby filters.
- Type: boolean
- Default:
0
Enables highlighting and indentation for code inside of:sass filters.
- Type: boolean
- Default:
0
Enables highlighting and indentation for code inside of:scss filters.
- Type: dictionary
This dictionary can be used to add highlighting and indentation for custom filters. Each key is the name of a filter that you want to provide syntax for and the corresponding value is the name of the Vim file type to load. For example:
letg:haml_custom_filters= #{\coffee:"coffeescript",\custom_ruby:"ruby"\}
The first entry in the above allows text inside of:coffee filters to be highlighted and indented as CoffeeScript, assuming that you have a syntax plugin installed that defines acoffeescript file type. The second entry allows text inside of a hypothetical custom filter named:custom_ruby to be highlighted and indented as Ruby.
About
Improved syntax highlighting and indentation for Ruby
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Contributors2
Uh oh!
There was an error while loading.Please reload this page.