Statemachine DSL example vim plugin
- Clone this repo
- Clone XText
- In one terminal, cd to your xtext directory and run
./gradlew jettyRun
- Test that your example webserver is running by going to http://localhost:8080
- Add this vim plugin via your favorite package manager
- Open
example.statemachine
in vim - Celebrate
One of the assets downloaded during this process may fail, if you google the filename you can find a new url for this file.
Examples for some popular plugin managers
" plug
" dev mode
Plug '~/code/vim-statemachine'
" production
Plug 'scottopell/vim-statemachine'
Usage:
$ ./validator.rb example.sm
This will return errors to you in the following format
<line>: <description>
<line>: <description>
<line>: <description>
An example errorformat would be '%l: %m'
where %l
is line # and %m
is
the error message.
Usage:
# File offset
$ ./complete.rb example.sm 5
# OR
# line and column
$ ./complete.rb example.sm 2 6
This will return a list of possible code completions from this point. You can pass it either an offset into the file as a character count or a row and column pair.
<token>
<othertoken>
<thirdtoken>
Usage:
$ cat example.sm | ./formatter.sh
This will format the code for you and print out the formatted code.