Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Latest commit

 

History

History
37 lines (23 loc) · 1.32 KB

VIM.md

File metadata and controls

37 lines (23 loc) · 1.32 KB

Cairo Language Server for Vim

Code assistance when writing Cairo smart contracts for StarkNet.

Makes use of the Cairo Language Server.

Note: This is an early preview and is still in active development.

vim-cairo

Features

  • Compiler support for .cairo files
  • Live diagnostic highlighting for compile errors
  • Quick fixes with suggestions provided by Cairo/StarkNet compiler
  • Go to definitions for imports
  • Code completion for imports

Setup

  1. Install Coc

  2. Install coc-cairo

  3. Add the following to ~/.vimrc

au BufReadPost *.cairo set filetype=cairo
au Filetype cairo set syntax=cairo
  1. Add Coc's example Vim configuration to ~/.vimrc

  2. Install Nile by following its Getting started steps, or follow the Cairo environment setup steps.

  3. For syntax highlighting, download https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/cairo/lang/ide/vim/syntax/cairo.vim to ~/.vim/syntax/

  4. Use Vim to open a .cairo file.