All Projects β†’ vim-crystal β†’ Vim Crystal

vim-crystal / Vim Crystal

Licence: mit
Vim filetype and tools support for Crystal language.

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to Vim Crystal

Vim Js
πŸ’―The most accurate syntax highlighting plugin for JavaScript and Flow.js
Stars: ✭ 99 (-69.63%)
Mutual labels:  vim-plugin, syntax-highlighting
Vim Systemd Syntax
Syntax highlighting for systemd service files in Vim.
Stars: ✭ 57 (-82.52%)
Mutual labels:  vim-plugin, syntax-highlighting
Rainbow levels.vim
A different approach to code highlighting.
Stars: ✭ 415 (+27.3%)
Mutual labels:  vim-plugin, syntax-highlighting
vim-smt2
A VIM plugin that adds support for the SMT-LIB2 format (including Z3's extensions)
Stars: ✭ 35 (-89.26%)
Mutual labels:  syntax-highlighting, vim-plugin
vim-log-highlighting
Syntax highlighting for generic log files in VIM
Stars: ✭ 164 (-49.69%)
Mutual labels:  syntax-highlighting, vim-plugin
Vim Gdscript3
Syntax highlighting and completion for GDScript 3
Stars: ✭ 121 (-62.88%)
Mutual labels:  vim-plugin, syntax-highlighting
Dhall Vim
Syntax highlighting for Dhall
Stars: ✭ 51 (-84.36%)
Mutual labels:  vim-plugin, syntax-highlighting
Kuroi.vim
A dark Vim colorscheme
Stars: ✭ 174 (-46.63%)
Mutual labels:  vim-plugin, syntax-highlighting
clojure.vim
Clojure syntax highlighting for Vim and Neovim.
Stars: ✭ 23 (-92.94%)
Mutual labels:  syntax-highlighting, vim-plugin
stan-vim
A Vim plugin for the Stan probabilistic programming language.
Stars: ✭ 41 (-87.42%)
Mutual labels:  syntax-highlighting, vim-plugin
Nord Jetbrains
An arctic, north-bluish clean and elegant JetBrains IDE UI and editor color theme.
Stars: ✭ 293 (-10.12%)
Mutual labels:  syntax-highlighting
Vim Repl
Best REPL environment for Vim
Stars: ✭ 296 (-9.2%)
Mutual labels:  vim-plugin
Vim Interestingwords
β˜€οΈ A vim plugin for highlighting and navigating through different words in a buffer.
Stars: ✭ 305 (-6.44%)
Mutual labels:  vim-plugin
Languageclient Neovim
Language Server Protocol (LSP) support for vim and neovim.
Stars: ✭ 3,352 (+928.22%)
Mutual labels:  vim-plugin
Mkdx
A vim plugin that adds some nice extra's for working with markdown documents
Stars: ✭ 295 (-9.51%)
Mutual labels:  vim-plugin
Chromatica.nvim
Clang based syntax highlighting for Neovim
Stars: ✭ 306 (-6.13%)
Mutual labels:  syntax-highlighting
Blamer.nvim
A git blame plugin for neovim inspired by VS Code's GitLens plugin
Stars: ✭ 283 (-13.19%)
Mutual labels:  vim-plugin
Handlebars
Fullest Handlebars.js templating support for Atom and Sublime Text 2 / 3. Also drives syntax colouring on Github and in Visual Studio Code. Install from: https://atom.io/packages/Handlebars and https://packagecontrol.io/packages/Handlebars.
Stars: ✭ 292 (-10.43%)
Mutual labels:  syntax-highlighting
Refractor
Lightweight, robust, elegant virtual syntax highlighting using Prism
Stars: ✭ 291 (-10.74%)
Mutual labels:  syntax-highlighting
Zeavim.vim
Zeal for Vim
Stars: ✭ 320 (-1.84%)
Mutual labels:  vim-plugin

Vim Filetype Support for Crystal

CI

This is Vim filetype support for Crystal programming language.

  • crystal filetype detection
  • Syntax highlight
  • Indentation
  • eCrystal support
  • vim-matchit support
  • crystal tool integration (implementations, context, formatter, and so on)
  • crystal spec integration
  • Syntax check (Using Syntastic)
  • Completion (currently for variable names)

Installation

Please copy autoload, ftdetect, ftplugin, indent, plugin and syntax directories into your ~/.vim (or ~/vimfiles in Windows) directory.

$ cp -R autoload ftdetect ftplugin indent plugin syntax ~/.vim/

$ # If you use vim-syntastic
$ cp -R syntax_checkers ~/.vim/

If you use Vim8, :packadd is available to install. Please see :help packages for more details.

Otherwise, please use your favorite plugin manager like vim-plug.

Syntax Highlight

screenshot

This plugin was firstly imported from Ruby's filetype plugin. There are many differences between Ruby and Crystal but vim-crystal can't support all of them yet. In addition, Crystal is growing rapidly and being added many changes. If you've found some issues or points to improve, pull requests and issues are welcome.

Spec Integration

screen shot: run spec

Running spec(s) and show the result in Vim. The output is colorful if possible as executed in CLI.

:CrystalSpecSwitch (mapping to gss)

It switches current source file and its spec file. This command assumes the standard directory layout which crystal init generates.

If you don't set g:crystal_define_mappings to 0, you can use this feature with mapping gss.

:CrystalSpecRunAll (mapping to gsa)

It runs the all specs for current file's project.

If you don't set g:crystal_define_mappings to 0, you can use this feature with mapping gsa.

:CrystalSpecRunCurrent (mapping to gsc)

It runs spec for current buffer.

  1. When current buffer is a spec source, :CrystalSpecRunCurrent runs the spec under the cursor. You should execute this command after moving cursor to it ... do line or describe ... do line.
  2. When current buffer is not a spec source, :CrystalSpecRunCurrent finds corresponding spec source and runs all specs in the source.

If you don't set g:crystal_define_mappings to 0, you can use this feature with mapping gsc.

Formatter Integration

format screenshot

You can run formatter manually by :CrystalFormat or automatically at saving buffer.

When you set g:crystal_auto_format to 1, current buffer is automatically formatted on BufWritePre. The variable is set to 0 by default because crystal tool format currently seems buggy.

Tool Integration

:CrystalDef (mapping to gd)

It makes cursor jump to the definition of name under the cursor. This command uses crystal tool implementations.

screenshot

If you don't set g:crystal_define_mappings to 0, you can use this feature with mapping gd.

:CrystalContext (mapping to gc)

It shows the context under the cursor. Context includes variable names and their types.

screenshot

If you don't set g:crystal_define_mappings to 0, you can use this feature with mapping gc.

:CrystalHierarchy

It shows types hierarchy of current code.

screenshot

:CrystalImpl

It shows how the identifier under the cursor is implemented. For example, when the cursor is on some property of an object instance, :CrystalImpl would report where the property is defined with property macro.

:CrystalExpand

It expands macro invocation under the cursor.

Completion

Omni completion for crystal can be used by <C-x><C-o>. (Please see :help ins-completion)

screenshot

Currently you can complete only variable names. If you want more advanced completion, please consider to use a language server like crystalline.

Maintainers

License

This plugin is distributed under the MIT License. Please read LICENSE.txt.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].