{"id":20329535,"url":"https://github.com/jlcrochet/vim-ruby","last_synced_at":"2025-04-11T20:50:37.703Z","repository":{"id":40534380,"uuid":"313670571","full_name":"jlcrochet/vim-ruby","owner":"jlcrochet","description":"Improved syntax highlighting and indentation for Ruby","archived":false,"fork":false,"pushed_at":"2024-10-03T14:34:03.000Z","size":211,"stargazers_count":19,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T18:02:20.328Z","etag":null,"topics":["eruby","indentation","ruby","syntax-highlighting","vim","vim-ftplugin","vim-indent","vim-plugin","vim-ruby","vim-syntax"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlcrochet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-17T16:00:36.000Z","updated_at":"2025-04-03T02:21:28.000Z","dependencies_parsed_at":"2024-08-20T17:55:03.194Z","dependency_job_id":"08a61ac0-1787-49d3-bd7f-0fa6bd03cc1b","html_url":"https://github.com/jlcrochet/vim-ruby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlcrochet%2Fvim-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlcrochet%2Fvim-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlcrochet%2Fvim-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlcrochet%2Fvim-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlcrochet","download_url":"https://codeload.github.com/jlcrochet/vim-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480512,"owners_count":21110936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eruby","indentation","ruby","syntax-highlighting","vim","vim-ftplugin","vim-indent","vim-plugin","vim-ruby","vim-syntax"],"created_at":"2024-11-14T20:11:40.984Z","updated_at":"2025-04-11T20:50:37.675Z","avatar_url":"https://github.com/jlcrochet.png","language":"Vim Script","readme":"## Introduction\n\nThis is intended to be a drop-in replacement for [vim-ruby](https://github.com/vim-ruby/vim-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.\n\nIn addition to regular Ruby files, this plugin also supports editing ERB and HAML files. If you want support for Ruby Signature files, check out my [vim-rbs](https://github.com/jlcrochet/vim-rbs) plugin.\n\n## Installation\n\nThis 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 recommend [vim-plug](https://github.com/junegunn/vim-plug).\n\n## Configuration\n\n### Ruby\n\n#### `g:ruby_simple_indent`\n\n* Type: boolean\n* Default: `0`\n\nThe 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:\n\n``` ruby\nx = if y\n      5\n    else\n      10\n    end\n\nx = begin\n      h[\"foo\"]\n    rescue KeyError\n      \"Not Found\"\n    end\n\nx = case y\n    when :foo\n      5\n    when :bar\n      10\n    else\n      1\n    end\n\nx = [:foo, :bar,\n     :baz, :qux]\n\nx = 5 + 10 +\n    15 + 20 -\n    5 * 3\n\nx = y.foo\n     .bar\n     .baz\n```\n\nFor those who prefer a more traditional indentation style or who desire slightly faster highlighting and indentation, set `g:ruby_simple_indent` to `1`. The above examples will now be indented thus:\n\n``` ruby\nx = if y\n  5\nelse\n  10\nend\n\nx = begin\n  h[\"foo\"]\nrescue KeyError\n  \"Not Found\"\nend\n\nx = case y\nwhen :foo\n  5\nwhen :bar\n  10\nelse\n  1\nend\n\nx = [:foo, :bar,\n  :baz, :qux]\n\n# OR\n\nx = [\n  :foo, :bar,\n  :baz, :qux\n]\n\nx = 5 + 10 +\n  15 + 20 -\n  5 * 3\n\n# OR\n\nx =\n  5 + 10 +\n  15 + 20 -\n  5 * 3\n\nx = y.foo\n  .bar\n  .baz\n\n# OR\n\nx = y\n  .foo\n  .bar\n  .baz\n```\n\n### HAML\n\nThe following variables enable syntax highlighting and indentation for code inside of HAML filters.\n\nNOTE: 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.\n\n#### `g:haml_filter_css`\n\n* Type: boolean\n* Default: `1`\n\nEnables highlighting and indentation for code inside of `:css` filters.\n\n#### `g:haml_filter_erb`\n\n* Type: boolean\n* Default: `0`\n\nEnables highlighting and indentation for code inside of `:erb` filters.\n\n#### `g:haml_filter_javascript`\n\n* Type: boolean\n* Default: `1`\n\nEnables highlighting and indentation for code inside of `:javascript` filters.\n\n#### `g:haml_filter_less`\n\n* Type: boolean\n* Default: `0`\n\nEnables highlighting and indentation for code inside of `:less` filters.\n\n#### `g:haml_filter_markdown`\n\n* Type: boolean\n* Default: `0`\n\nEnables highlighting and indentation for code inside of `:markdown` filters.\n\n#### `g:haml_filter_ruby`\n\n* Type: boolean\n* Default: `1`\n\nEnables highlighting and indentation for code inside of `:ruby` filters.\n\n#### `g:haml_filter_sass`\n\n* Type: boolean\n* Default: `0`\n\nEnables highlighting and indentation for code inside of `:sass` filters.\n\n#### `g:haml_filter_scss`\n\n* Type: boolean\n* Default: `0`\n\nEnables highlighting and indentation for code inside of `:scss` filters.\n\n#### `g:haml_custom_filters`\n\n* Type: dictionary\n\nThis 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:\n\n``` vim\nlet g:haml_custom_filters = #{\n    \\ coffee: \"coffeescript\",\n    \\ custom_ruby: \"ruby\"\n    \\ }\n```\n\nThe 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 a `coffeescript` file type. The second entry allows text inside of a hypothetical custom filter named `:custom_ruby` to be highlighted and indented as Ruby.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlcrochet%2Fvim-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlcrochet%2Fvim-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlcrochet%2Fvim-ruby/lists"}