{"id":15713677,"url":"https://github.com/jlcrochet/vim-crystal","last_synced_at":"2025-04-30T16:07:45.382Z","repository":{"id":45056696,"uuid":"309593819","full_name":"jlcrochet/vim-crystal","owner":"jlcrochet","description":"Improved Vim syntax highlighting and indentation for Crystal","archived":false,"fork":false,"pushed_at":"2024-05-21T02:39:49.000Z","size":306,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T13:14:21.953Z","etag":null,"topics":["crystal","crystal-lang","indentation","syntax-highlighting","vim","vim-crystal","vim-ftplugin","vim-indent","vim-plugin","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-03T06:25:00.000Z","updated_at":"2025-02-13T18:33:34.000Z","dependencies_parsed_at":"2024-10-24T10:51:56.102Z","dependency_job_id":"5e2e014f-0944-4d1c-8e11-c10ecda09a02","html_url":"https://github.com/jlcrochet/vim-crystal","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-crystal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlcrochet%2Fvim-crystal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlcrochet%2Fvim-crystal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlcrochet%2Fvim-crystal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlcrochet","download_url":"https://codeload.github.com/jlcrochet/vim-crystal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251739052,"owners_count":21635891,"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":["crystal","crystal-lang","indentation","syntax-highlighting","vim","vim-crystal","vim-ftplugin","vim-indent","vim-plugin","vim-syntax"],"created_at":"2024-10-03T21:32:53.113Z","updated_at":"2025-04-30T16:07:45.348Z","avatar_url":"https://github.com/jlcrochet.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n\nThis was originally a fork of [vim-crystal](https://github.com/vim-crystal/vim-crystal) that discarded many of the original's features in order to study how syntax highlighting and indentation could be improved. It turned into a complete rewrite of the original plugin and merging my changes was no longer feasible, so I decided to move it to a separate repository for anyone who wants a faster and more accurate alternative to the original vim-crystal.\n\nThis plugin includes support for [embedded crystal (ECR)](https://crystal-lang.org/api/latest/ECR.html).\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#### `g:crystal_simple_indent`\n\nThe default indentation style used by this plugin is the one most commonly found in the Crystal community, which allows for \"hanging\" or \"floating\" indentation. Some examples:\n\n~~~crystal\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:crystal_simple_indent` to `1`. The above examples will now be indented thus:\n\n~~~crystal\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# OR\nx = [\n  :foo, :bar,\n  :baz, :qux\n]\n\nx = 5 + 10 +\n  15 + 20 -\n  5 * 3\n# OR\nx =\n  5 + 10 +\n  15 + 20 -\n  5 * 3\n\nx = y.foo\n  .bar\n  .baz\n# OR\nx = y\n  .foo\n  .bar\n  .baz\n~~~\n\n#### `g:crystal_markdown_comments`\n\nThis variable controls whether or not Markdown should be highlighted in comments; it can have three possible values:\n\n* `0`: Disabled (default)\n* `1`: Enabled\n* `2`: Enabled; additionally, code lines \u0026mdash; that is, lines that begin with at least four spaces or one tab or are inside of a fenced code block (delimited with ` ``` ` or `~~~`) \u0026mdash; will be highlighted as Crystal code unless the language for the block is set to anything other than `crystal` (good for writing documentation)\n\nSetting to `1` or `2` may cause highlighting to become slower in files with lots of comments.\n\nNOTE: I haven't yet been able to find an exhaustive summary of which Markdown features are supported by Crystal, so for now, only the basic features are supported in addition to fenced code blocks (delimited with ` ``` ` or `~~~`).\n\nAdditionally, the only decorations that are currently allowed to span multiple lines are fenced code blocks. For example, the following will not be highlighted properly:\n\n~~~crystal\n# `1 + 2 +\n# 3`\n~~~\n\nBut this will:\n\n~~~crystal\n# ```\n# 1 + 2 +\n# 3\n# ```\n~~~\n\n#### `g:ecrystal_extensions`\n\nThis plugin uses a dictionary of filetype extensions to determine which filetype to use when loading ECR files. For example, opening a file named `foo.html.ecr` will load HTML as the filetype with ECR syntax added on top.\n\nThe default recognized filetype extensions are as follows:\n\n~~~\n.html =\u003e html\n.js =\u003e javascript\n~~~\n\nEach extension maps to the name of the filetype that you want to load for that extension.\n\nTo add or overwrite entries in the dictionary, set `g:ecrystal_extensions` to a dictionary with the entries you want to inject. For example, the following would allow the plugin to recognize `*.md` files as Markdown:\n\n~~~vim\nlet g:ecrystal_extensions = #{ md: \"markdown\" }\n~~~\n\nIf no subtype is specified in the file name itself (e.g., `foo.ecr`), the value of `g:ecrystal_default_subtype` is used as the subtype.\n\n#### `g:ecrystal_default_subtype`\n\nDetermines the default subtype to use for ECR files when no subtype is specified in the file name itself (e.g., `foo.ecr`).\n\nThe default value is `html`. Setting this to nothing (`let g:ecrystal_default_subtype = \"\"`) will cause no subtype to be used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlcrochet%2Fvim-crystal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlcrochet%2Fvim-crystal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlcrochet%2Fvim-crystal/lists"}