dyon vim syntax plugin
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
I recently made vim-dyon which is a syntax highlighter and indenter for the dyon programming language. There are probably some issues with being absolutely correct (since I am not too familiar with dyon), but it seems to do a good job in terms of how it works and looks. I am new to VimScript and I am looking for mostly a critique of my VimScript.
ftdetect/dyon.vim
autocmd BufNewFile,BufRead *.dyon setfiletype dyon
ftplugin/dyon.vim
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
indent/dyon.vim
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
if exists("*DyonIndent")
finish
endif
" Dyon works similar to C, but without ;.
setlocal smartindent
syntax/dyon.vim
if exists("b:current_syntax")
finish
endif
" Function/Closure
syntax keyword dyonKeyword fn grab
" Boolean
syntax keyword dyonKeyword true false
" Control keywords
syntax keyword dyonKeyword break continue else if for loop return in
" Special keywords
syntax keyword dyonKeyword mut go in any vec4
highlight link dyonKeyword Keyword
" Highlight functions
" (see: https://stackoverflow.com/a/45626295/667648)
syntax match dyonFunction "zs(kw*)*s*ze("
highlight link dyonFunction Function
" Arithmetic operations
" a * b
syntax match dyonOperator "v*"
" a / b
syntax match dyonOperator "v/"
" a % b
syntax match dyonOperator "v%"
" a + b
syntax match dyonOperator "v+"
" a - b
syntax match dyonOperator "v-"
" a ^ b
syntax match dyonOperator "v^"
" a *= b
syntax match dyonOperator "v*="
" a /= b
syntax match dyonOperator "v/="
" a %= b
syntax match dyonOperator "v%="
" a += b
syntax match dyonOperator "v+="
" a -= b
syntax match dyonOperator "v-="
" a ^= b
syntax match dyonOperator "v^="
" a := b
syntax match dyonOperator "v:="
syntax match dyonOperator "v[a-zA-z]+:"
" Boolean operations
" a && b
syntax match dyonOperator "v&&"
" a and b
syntax match dyonOperator "v and "
" a || b
syntax match dyonOperator "v||"
" a or b
syntax match dyonOperator "v or "
highlight link dyonOperator Operator
" Numbers and strings
" (see
" https://github.com/pangloss/vim-javascript/blob/89fcb6bfcada1c4256284723778d128342b48350/syntax/javascript.vim#L57)
syntax match dyonString "v#[0-9a-f]+"
syntax match dyonString /c<%(d+%(e[+-]=d+)=|0b[01]+|0oo+|0xx+)>/
syntax region dyonString start=/v"/ skip=/v\./ end=/v"/
highlight link dyonString String
highlight link dyonNumber String
" Matches // style comment
syntax region dyonComment start="//" end="$"
highlight link dyonComment Comment
let b:current_syntax = "dyon"
regex grammar vimscript
add a comment |Â
up vote
2
down vote
favorite
I recently made vim-dyon which is a syntax highlighter and indenter for the dyon programming language. There are probably some issues with being absolutely correct (since I am not too familiar with dyon), but it seems to do a good job in terms of how it works and looks. I am new to VimScript and I am looking for mostly a critique of my VimScript.
ftdetect/dyon.vim
autocmd BufNewFile,BufRead *.dyon setfiletype dyon
ftplugin/dyon.vim
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
indent/dyon.vim
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
if exists("*DyonIndent")
finish
endif
" Dyon works similar to C, but without ;.
setlocal smartindent
syntax/dyon.vim
if exists("b:current_syntax")
finish
endif
" Function/Closure
syntax keyword dyonKeyword fn grab
" Boolean
syntax keyword dyonKeyword true false
" Control keywords
syntax keyword dyonKeyword break continue else if for loop return in
" Special keywords
syntax keyword dyonKeyword mut go in any vec4
highlight link dyonKeyword Keyword
" Highlight functions
" (see: https://stackoverflow.com/a/45626295/667648)
syntax match dyonFunction "zs(kw*)*s*ze("
highlight link dyonFunction Function
" Arithmetic operations
" a * b
syntax match dyonOperator "v*"
" a / b
syntax match dyonOperator "v/"
" a % b
syntax match dyonOperator "v%"
" a + b
syntax match dyonOperator "v+"
" a - b
syntax match dyonOperator "v-"
" a ^ b
syntax match dyonOperator "v^"
" a *= b
syntax match dyonOperator "v*="
" a /= b
syntax match dyonOperator "v/="
" a %= b
syntax match dyonOperator "v%="
" a += b
syntax match dyonOperator "v+="
" a -= b
syntax match dyonOperator "v-="
" a ^= b
syntax match dyonOperator "v^="
" a := b
syntax match dyonOperator "v:="
syntax match dyonOperator "v[a-zA-z]+:"
" Boolean operations
" a && b
syntax match dyonOperator "v&&"
" a and b
syntax match dyonOperator "v and "
" a || b
syntax match dyonOperator "v||"
" a or b
syntax match dyonOperator "v or "
highlight link dyonOperator Operator
" Numbers and strings
" (see
" https://github.com/pangloss/vim-javascript/blob/89fcb6bfcada1c4256284723778d128342b48350/syntax/javascript.vim#L57)
syntax match dyonString "v#[0-9a-f]+"
syntax match dyonString /c<%(d+%(e[+-]=d+)=|0b[01]+|0oo+|0xx+)>/
syntax region dyonString start=/v"/ skip=/v\./ end=/v"/
highlight link dyonString String
highlight link dyonNumber String
" Matches // style comment
syntax region dyonComment start="//" end="$"
highlight link dyonComment Comment
let b:current_syntax = "dyon"
regex grammar vimscript
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I recently made vim-dyon which is a syntax highlighter and indenter for the dyon programming language. There are probably some issues with being absolutely correct (since I am not too familiar with dyon), but it seems to do a good job in terms of how it works and looks. I am new to VimScript and I am looking for mostly a critique of my VimScript.
ftdetect/dyon.vim
autocmd BufNewFile,BufRead *.dyon setfiletype dyon
ftplugin/dyon.vim
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
indent/dyon.vim
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
if exists("*DyonIndent")
finish
endif
" Dyon works similar to C, but without ;.
setlocal smartindent
syntax/dyon.vim
if exists("b:current_syntax")
finish
endif
" Function/Closure
syntax keyword dyonKeyword fn grab
" Boolean
syntax keyword dyonKeyword true false
" Control keywords
syntax keyword dyonKeyword break continue else if for loop return in
" Special keywords
syntax keyword dyonKeyword mut go in any vec4
highlight link dyonKeyword Keyword
" Highlight functions
" (see: https://stackoverflow.com/a/45626295/667648)
syntax match dyonFunction "zs(kw*)*s*ze("
highlight link dyonFunction Function
" Arithmetic operations
" a * b
syntax match dyonOperator "v*"
" a / b
syntax match dyonOperator "v/"
" a % b
syntax match dyonOperator "v%"
" a + b
syntax match dyonOperator "v+"
" a - b
syntax match dyonOperator "v-"
" a ^ b
syntax match dyonOperator "v^"
" a *= b
syntax match dyonOperator "v*="
" a /= b
syntax match dyonOperator "v/="
" a %= b
syntax match dyonOperator "v%="
" a += b
syntax match dyonOperator "v+="
" a -= b
syntax match dyonOperator "v-="
" a ^= b
syntax match dyonOperator "v^="
" a := b
syntax match dyonOperator "v:="
syntax match dyonOperator "v[a-zA-z]+:"
" Boolean operations
" a && b
syntax match dyonOperator "v&&"
" a and b
syntax match dyonOperator "v and "
" a || b
syntax match dyonOperator "v||"
" a or b
syntax match dyonOperator "v or "
highlight link dyonOperator Operator
" Numbers and strings
" (see
" https://github.com/pangloss/vim-javascript/blob/89fcb6bfcada1c4256284723778d128342b48350/syntax/javascript.vim#L57)
syntax match dyonString "v#[0-9a-f]+"
syntax match dyonString /c<%(d+%(e[+-]=d+)=|0b[01]+|0oo+|0xx+)>/
syntax region dyonString start=/v"/ skip=/v\./ end=/v"/
highlight link dyonString String
highlight link dyonNumber String
" Matches // style comment
syntax region dyonComment start="//" end="$"
highlight link dyonComment Comment
let b:current_syntax = "dyon"
regex grammar vimscript
I recently made vim-dyon which is a syntax highlighter and indenter for the dyon programming language. There are probably some issues with being absolutely correct (since I am not too familiar with dyon), but it seems to do a good job in terms of how it works and looks. I am new to VimScript and I am looking for mostly a critique of my VimScript.
ftdetect/dyon.vim
autocmd BufNewFile,BufRead *.dyon setfiletype dyon
ftplugin/dyon.vim
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
indent/dyon.vim
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
if exists("*DyonIndent")
finish
endif
" Dyon works similar to C, but without ;.
setlocal smartindent
syntax/dyon.vim
if exists("b:current_syntax")
finish
endif
" Function/Closure
syntax keyword dyonKeyword fn grab
" Boolean
syntax keyword dyonKeyword true false
" Control keywords
syntax keyword dyonKeyword break continue else if for loop return in
" Special keywords
syntax keyword dyonKeyword mut go in any vec4
highlight link dyonKeyword Keyword
" Highlight functions
" (see: https://stackoverflow.com/a/45626295/667648)
syntax match dyonFunction "zs(kw*)*s*ze("
highlight link dyonFunction Function
" Arithmetic operations
" a * b
syntax match dyonOperator "v*"
" a / b
syntax match dyonOperator "v/"
" a % b
syntax match dyonOperator "v%"
" a + b
syntax match dyonOperator "v+"
" a - b
syntax match dyonOperator "v-"
" a ^ b
syntax match dyonOperator "v^"
" a *= b
syntax match dyonOperator "v*="
" a /= b
syntax match dyonOperator "v/="
" a %= b
syntax match dyonOperator "v%="
" a += b
syntax match dyonOperator "v+="
" a -= b
syntax match dyonOperator "v-="
" a ^= b
syntax match dyonOperator "v^="
" a := b
syntax match dyonOperator "v:="
syntax match dyonOperator "v[a-zA-z]+:"
" Boolean operations
" a && b
syntax match dyonOperator "v&&"
" a and b
syntax match dyonOperator "v and "
" a || b
syntax match dyonOperator "v||"
" a or b
syntax match dyonOperator "v or "
highlight link dyonOperator Operator
" Numbers and strings
" (see
" https://github.com/pangloss/vim-javascript/blob/89fcb6bfcada1c4256284723778d128342b48350/syntax/javascript.vim#L57)
syntax match dyonString "v#[0-9a-f]+"
syntax match dyonString /c<%(d+%(e[+-]=d+)=|0b[01]+|0oo+|0xx+)>/
syntax region dyonString start=/v"/ skip=/v\./ end=/v"/
highlight link dyonString String
highlight link dyonNumber String
" Matches // style comment
syntax region dyonComment start="//" end="$"
highlight link dyonComment Comment
let b:current_syntax = "dyon"
regex grammar vimscript
edited Feb 25 at 2:21
Jamalâ¦
30.1k11114225
30.1k11114225
asked Feb 24 at 20:30
Dair
3,953627
3,953627
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f188289%2fdyon-vim-syntax-plugin%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password