Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

swan-of-bodom/starknet-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ Deprecated since the release of Cairo 1. Now using Scarb Vim.

Starknet Vim

Updated Vim plugin to write Cairo contracts on Starknet.

  1. Auto-format
  2. Syntax highlighting
  3. Asynchronous linting with Vim ALE
  4. Ctags

Tags:

image

Linting:

image

image

Ctags regex:

--langdef=cairo
--map-cairo=+.cairo
--mline-regex-cairo=/@event([[:space:]])*([a-z ]+)[[:space:]]*([a-zA-Z]*)\(/\3\4/e,event/{mgroup=0}
--mline-regex-cairo=/@storage_var([[:space:]]+)func[ \t]+([a-zA-Z0-9_]+)*\(/\2\3/s,storage/{mgroup=0}
--mline-regex-cairo=/@constructor([[:space:]]+)func*([a-z ]+)*\{/\2\3/c,constructor/{mgroup=0}
--mline-regex-cairo=/@external([[:space:]]+)func*(.*)\{/\2\3/f,external/{mgroup=0}
--mline-regex-cairo=/@view([[:space:]]+)func*(.*)\{/\2\3/v,view/{mgroup=0}
--mline-regex-cairo=/(error_message+)\("(.*)\"/\2\3/r,error/{mgroup=0}

Install

with Vim-Plug:

Plug '0xhyoga/starknet-vim'

and put this in your .vimrc:

filetype plugin on

For ALE you can install here: https://github.com/dense-analysis/ale

For universal Ctags you can follow here for instructions https://github.com/universal-ctags/ctags

Depending on your setup, you will need to create a .ctags file with the above regex rules

About

Vim Starknet plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published