diff --git a/contrib/vim b/contrib/vim new file mode 100644 index 000000000..0877d674f --- /dev/null +++ b/contrib/vim @@ -0,0 +1 @@ +vim support can be found at https://github.com/ChaiScript/vim-chaiscript diff --git a/contrib/vim/README.txt b/contrib/vim/README.txt deleted file mode 100644 index a79b1e753..000000000 --- a/contrib/vim/README.txt +++ /dev/null @@ -1,7 +0,0 @@ -Install ftdetect, indent and syntax subdirectories to: - -~/.vim/ - -See the vim documentation on this: - -http://vimdoc.sourceforge.net/htmldoc/syntax.html#mysyntaxfile diff --git a/contrib/vim/ftdetect/chaiscript.vim b/contrib/vim/ftdetect/chaiscript.vim deleted file mode 100644 index c4ce5ef29..000000000 --- a/contrib/vim/ftdetect/chaiscript.vim +++ /dev/null @@ -1,2 +0,0 @@ -au BufRead,BufNewFile *.chai set filetype=chaiscript - diff --git a/contrib/vim/indent/chaiscript.vim b/contrib/vim/indent/chaiscript.vim deleted file mode 100644 index 247e1a6e4..000000000 --- a/contrib/vim/indent/chaiscript.vim +++ /dev/null @@ -1,50 +0,0 @@ -" Vim indent file -" Language: ChaiScript -" Maintainer: Jason Turner - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -setlocal indentexpr=GetChaiScriptIndent() -setlocal autoindent - -" Only define the function once. -if exists("*GetChaiScriptIndent") - finish -endif - -function! GetChaiScriptIndent() - " Find a non-blank line above the current line. - let lnum = prevnonblank(v:lnum - 1) - - " Hit the start of the file, use zero indent. - if lnum == 0 - return 0 - endif - - " Add a 'shiftwidth' after lines that start a block: - " lines containing a { - let ind = indent(lnum) - let flag = 0 - let prevline = getline(lnum) - if prevline =~ '^.*{.*' - let ind = ind + &shiftwidth - let flag = 1 - endif - - " Subtract a 'shiftwidth' after lines containing a { followed by a } - " to keep it balanced - if flag == 1 && prevline =~ '.*{.*}.*' - let ind = ind - &shiftwidth - endif - - " Subtract a 'shiftwidth' on lines ending with } - if getline(v:lnum) =~ '^\s*\%(}\)' - let ind = ind - &shiftwidth - endif - - return ind -endfunction diff --git a/contrib/vim/syntax/chaiscript.vim b/contrib/vim/syntax/chaiscript.vim deleted file mode 100644 index b442aaa90..000000000 --- a/contrib/vim/syntax/chaiscript.vim +++ /dev/null @@ -1,99 +0,0 @@ -" Vim syntax file -" Language: ChaiScript -" Maintainer: Jason Turner - -" Quit when a (custom) syntax file was already loaded -if exists("b:current_syntax") - finish -end - -let s:cpo_save = &cpo -set cpo&vim - -syn case match - -" syncing method -syn sync fromstart - -" Strings -syn region chaiscriptString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=chaiscriptSpecial,chaiscriptEval,@Spell - -" Escape characters -syn match chaiscriptSpecial contained "\\[\\abfnrtv\'\"]\|\\\d\{,3}" - -" String evals -syn region chaiscriptEval contained start="${" end="}" - -" integer number -syn match chaiscriptNumber "\<\d\+\>" - -" floating point number, with dot, optional exponent -syn match chaiscriptFloat "\<\d\+\.\d*\%(e[-+]\=\d\+\)\=\>" - -" floating point number, starting with a dot, optional exponent -syn match chaiscriptFloat "\.\d\+\%(e[-+]\=\d\+\)\=\>" - -" floating point number, without dot, with exponent -syn match chaiscriptFloat "\<\d\+e[-+]\=\d\+\>" - -" Hex strings -syn match chaiscriptNumber "\<0x\x\+\>" - -" Binary strings -syn match chaiscriptNumber "\<0b[01]\+\>" - -" Various language features -syn keyword chaiscriptCond if else -syn keyword chaiscriptRepeat while for do -syn keyword chaiscriptStatement break continue return switch case default -syn keyword chaiscriptExceptions try catch throw - -"Keyword -syn keyword chaiscriptKeyword def true false attr - -"Built in types -syn keyword chaiscriptType fun var auto - -"Built in funcs, keep it simple -syn keyword chaiscriptFunc eval throw - -"Let's treat all backtick operator function lookups as built in too -syn region chaiscriptFunc matchgroup=chaiscriptFunc start="`" end="`" - -" Account for the "[1..10]" syntax, treating it as an operator -" Intentionally leaving out all of the normal, well known operators -syn match chaiscriptOperator "\.\." - -" Guard seperator as an operator -syn match chaiscriptOperator ":" - -" Comments -syn match chaiscriptComment "//.*$" contains=@Spell -syn region chaiscriptComment matchgroup=chaiscriptComment start="/\*" end="\*/" contains=@Spell - - - -hi def link chaiscriptExceptions Exception -hi def link chaiscriptKeyword Keyword -hi def link chaiscriptStatement Statement -hi def link chaiscriptRepeat Repeat -hi def link chaiscriptString String -hi def link chaiscriptNumber Number -hi def link chaiscriptFloat Float -hi def link chaiscriptOperator Operator -hi def link chaiscriptConstant Constant -hi def link chaiscriptCond Conditional -hi def link chaiscriptFunction Function -hi def link chaiscriptComment Comment -hi def link chaiscriptTodo Todo -hi def link chaiscriptError Error -hi def link chaiscriptSpecial SpecialChar -hi def link chaiscriptFunc Identifier -hi def link chaiscriptType Type -hi def link chaiscriptEval Special - -let b:current_syntax = "chaiscript" - -let &cpo = s:cpo_save -unlet s:cpo_save -" vim: nowrap sw=2 sts=2 ts=8 noet