pax_global_header00006660000000000000000000000064140101267220014505gustar00rootroot0000000000000052 comment=c32c7cf25fa7c6cf2c7dbf4894df3e581b8090ee vim-nomsu/000077500000000000000000000000001401012672200130035ustar00rootroot00000000000000vim-nomsu/README.md000066400000000000000000000003611401012672200142620ustar00rootroot00000000000000This is a vim syntax plugin for the [Nomsu programming language](https://nomsu.org). I recommend using [vim-plug](https://github.com/junegunn/vim-plug) to install it: ``` Plug 'https://bitbucket.org/spilt/vim-nomsu', { 'for': 'nomsu' } ``` vim-nomsu/ftdetect/000077500000000000000000000000001401012672200146055ustar00rootroot00000000000000vim-nomsu/ftdetect/nomsu.vim000066400000000000000000000002201401012672200164550ustar00rootroot00000000000000" Language: Nomsu " Maintainer: Bruce Hill " License: WTFPL autocmd BufNewFile,BufRead *.nom set filetype=nomsu vim-nomsu/ftplugin/000077500000000000000000000000001401012672200146335ustar00rootroot00000000000000vim-nomsu/ftplugin/nomsu.vim000066400000000000000000000010341401012672200165070ustar00rootroot00000000000000" Language: Nomsu " Maintainer: Bruce Hill " License: WTFPL if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 setlocal formatoptions-=t setlocal iskeyword+=$ setlocal cpoptions+=M setlocal foldmethod=indent setlocal formatprg=nomsu\ -t\ format\ -q\ - setlocal expandtab setlocal tabstop=4 setlocal shiftwidth=0 setlocal commentstring=//\ %s normal zR command! NomsuHideTests :g/^\s*test:$/exe "normal! jzc" let b:undo_ftplugin = "setlocal formatoptions< iskeyword< cpoptions< foldmethod<" vim-nomsu/indent/000077500000000000000000000000001401012672200142645ustar00rootroot00000000000000vim-nomsu/indent/nomsu.vim000066400000000000000000000016541401012672200161500ustar00rootroot00000000000000" Language: Nomsu " Maintainer: Bruce Hill " License: WTFPL if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent setlocal indentexpr=GetNomsuIndent() setlocal indentkeys+=0],0),1),1. " Only define the function once. if exists("*GetNomsuIndent") finish endif function! GetNomsuIndent() let line = getline(v:lnum) let current_ind = indent(v:lnum) let previousNum = prevnonblank(v:lnum - 1) let previous = getline(previousNum) let ind = indent(previousNum) " TODO: don't auto-indent inside a multi-line comment? if previous =~ '\%([{[(:]\|("\)$' && previous !~ '^\s*#' let ind += &tabstop endif " TODO: dedent to matching parens, don't just dedent once if line =~ '^\s*\%([\])}]\|")\|\.\.\)' "let ind -= &tabstop return current_ind - &tabstop endif if ind == indent(previousNum) return current_ind endif return ind endfunction vim-nomsu/syntax/000077500000000000000000000000001401012672200143315ustar00rootroot00000000000000vim-nomsu/syntax/nomsu.vim000066400000000000000000000114261401012672200162130ustar00rootroot00000000000000" Language: Nomsu " Maintainer: Bruce Hill " License: WTFPL " Bail if our syntax is already loaded. if exists('b:current_syntax') && b:current_syntax == 'nomsu' finish endif " Highlight long strings. syn sync minlines=100 "hi def link nomsuInterpDelim PreProc hi nomsuInterpDelim ctermfg=Gray syn region nomsuLineComment start=;//; end=/$/ hi nomsuLineComment ctermfg=DarkBlue hi def link nomsuLineComment Comment syn region nomsuList start=/\[/ end=/\]/ contains=@nomsuAll hi nomsuList ctermfg=Blue syn region nomsuDict start=/{/ end=/}/ contains=@nomsuAll hi nomsuDict ctermfg=Green syn region nomsuParenGroup start=/(/ end=/)/ contains=@nomsuAll hi nomsuParenGroup ctermfg=Yellow syn match nomsuTextBackslash /\\\%(\\\|;\)\@=/ nextgroup=nomsuTextEscapedBackslash contained hi nomsuTextBackslash ctermfg=Gray syn match nomsuTextEscapedChar /\%(\\\)\@<=\%(\x\{1,3}\|x\x\{1,2}\|.\)/ contained hi nomsuTextEscapedChar cterm=bold ctermfg=Blue syn match nomsuTextEscapedBackslash /./ contained hi nomsuTextEscapedBackslash cterm=bold ctermfg=Blue syn match nomsuTextEscape /\\\%(\x\{1,3}\|x\x\{1,2}\|.\)/ contains=nomsuTextEscapedChar contained hi nomsuTextEscape ctermfg=Gray syn match nomsuInterp /\\\%([[{($:]\)\@=/ \ nextgroup=nomsuActionVar,nomsuVar,nomsuList,nomsuDict,nomsuParenGroup,nomsuIndentedInterpBlock contained hi nomsuInterp ctermfg=Gray syn region nomsuInterpDotDot matchgroup=nomsuInterpDelim start=/\\\s*$/ end=/\.\./ contained hi nomsuInterpDotDot ctermfg=Gray syn region nomsuIndentedText matchgroup=nomsuTextQuotes start=/\%(^\z(\(\s*\)\)[^\n]*\)\@<=("$/ end=/^\z1")/ \ contains=nomsuInterp,nomsuInterpDotDot,nomsuTextBackslash hi def link nomsuIndentedText String hi nomsuTextQuotes ctermfg=DarkMagenta syn region nomsuText matchgroup=nomsuTextQuotes start=/\%((\)\@?'/-]\)\+\|\%(^\s*\)\@?'/-]\)\+\|\%(^\s*\)\@