editors

changeset 1:d6c98c374a2c

* Vim syntax files
author Jeremy Cowgar <jeremy@cowgar.com>
date Sat Aug 29 16:11:17 2009 +0000 (2009-08-29)
parents b87a9abe5f4c
children f585b44372fe
files vim/ftplugin/euphoria.vim vim/indent/euphoria.vim vim/syntax/creole.vim vim/syntax/euphoria.vim
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/vim/ftplugin/euphoria.vim	Sat Aug 29 16:11:17 2009 +0000
     1.3 @@ -0,0 +1,17 @@
     1.4 +if exists("b:did_ftplugin")
     1.5 +	finish
     1.6 +endif
     1.7 +
     1.8 +let b:did_ftplugin = 1
     1.9 +
    1.10 +setlocal fo-=t fo+=croql
    1.11 +
    1.12 +if &tw == 0
    1.13 +	setlocal tw=95
    1.14 +endif
    1.15 +
    1.16 +setlocal commentstring=--%s
    1.17 +
    1.18 +noremap <silent><buffer> [[ m':call search('^\s*\(\(global\|export\|public\|override\)\s*\)*\(function\|procedure\|type\)', "bW")<CR>
    1.19 +noremap <silent><buffer> ]] m':call search('^\s*\(\(global\|export\|public\|override\)\s*\)*\(function\|procedure\|type\)', "W")<CR>
    1.20 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/vim/indent/euphoria.vim	Sat Aug 29 16:11:17 2009 +0000
     2.3 @@ -0,0 +1,57 @@
     2.4 +" Vim indent file
     2.5 +" Language:	Euphoria
     2.6 +" Author:	Jeremy Cowgar <jeremy@cowgar.com>
     2.7 +" Last Change:	2002 Dec 19 10:36 PM 2002 EST
     2.8 +" Version:	0.5
     2.9 +" Notes:  Euphoria: http://www.rapideuphoria.com
    2.10 +"
    2.11 +
    2.12 +" Only load this indent file when no other was loaded.
    2.13 +if exists("b:did_indent")
    2.14 +	finish
    2.15 +endif
    2.16 +let b:did_indent = 1
    2.17 +
    2.18 +setlocal indentexpr=GetEuphoriaIndent()
    2.19 +setlocal indentkeys+==end,=function,=procedure,=type,=switch,=case,=constant,=enum,=if,=elsif,=else,=for,=while,=entry
    2.20 +
    2.21 +" Only define the function once.
    2.22 +if exists("*GetEuphoriaIndent")
    2.23 +	finish
    2.24 +endif
    2.25 +
    2.26 +function GetEuphoriaIndent()
    2.27 +	" Find a non-blank line above the current line.
    2.28 +	let lnum = prevnonblank(v:lnum - 1)
    2.29 +
    2.30 +	" Hit the start of the file, use zero indent.
    2.31 +	if lnum == 0
    2.32 +		return 0
    2.33 +	endif
    2.34 +
    2.35 +	let line  = getline(lnum)    " last line
    2.36 +	let cline = getline(v:lnum) " current line
    2.37 +	let pline = getline(lnum - 1) " previous to last line
    2.38 +	let ind   = indent(lnum)
    2.39 +   
    2.40 +	if line =~ '^\s*\(\(global\|export\|public\|override\)\s*\)*\(function\|procedure\|type\)'
    2.41 +		let ind = ind + &sw
    2.42 +	elseif line =~ '^\s*\(if\|elsif\|else\|for\|while\|case\|entry\)'
    2.43 +		let ind = ind + &sw
    2.44 +	elseif line =~ '^\s*switch'
    2.45 +		let ind = ind + (&sw * 2)
    2.46 +	elseif line =~ '^\s*\(\(global\|export\|public\|override\)\s*\)*\(constant\|enum\).*,$'
    2.47 +		let ind = ind + &sw
    2.48 +	endif
    2.49 +
    2.50 +	if cline =~ '^\s*end\s+switch'
    2.51 +		let ind = ind - (&sw * 2)
    2.52 +	elseif cline =~ '^\s*\(end\|else\|elsif\|case\|entry\)'
    2.53 +		let ind = ind - &sw
    2.54 +	endif
    2.55 +	
    2.56 +	return ind
    2.57 +endfunction
    2.58 +
    2.59 +" vim: set ts=4 sw=4:
    2.60 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/vim/syntax/creole.vim	Sat Aug 29 16:11:17 2009 +0000
     3.3 @@ -0,0 +1,93 @@
     3.4 +" Vim syntax file
     3.5 +" Language:     creole
     3.6 +" Maintainer:   Peter Hoffmann <ph@peter-hoffmann.com>
     3.7 +" Last Change:  2007 May 31
     3.8 +
     3.9 +" This syntax file is based on the wiki.vim syntax file from Andreas Kneib
    3.10 +
    3.11 +" Little syntax file to use a wiki-editor with VIM
    3.12 +" (if your browser allow this action) 
    3.13 +" To use this syntax file:
    3.14 +" 1. mkdir ~/.vim/syntax
    3.15 +" 2. mv ~/creole.vim ~/.vim/syntax/creole.vim
    3.16 +" 3. :set syntax=creole
    3.17 +"
    3.18 +
    3.19 +"Some hints to extend wiki creole editing
    3.20 +"set path=.,~/wiki/
    3.21 +"au BufRead,BufNewFile *.txt setfiletype creole
    3.22 +
    3.23 +"write current file and open file under cursor in new tab
    3.24 +"nnoremap gF :w<cr> :tabedit <cfile><cr>
    3.25 +
    3.26 +"use the snippetsEmu plugin for wiki code
    3.27 +"Snippet { {{{<CR><{}><CR>}}}<CR><{}>
    3.28 +"Snippet * **<{}>** <{}> 
    3.29 +"Snippet _ __<{}>__ <{}> 
    3.30 +"Snippet - --<{}>-- <{}> 
    3.31 +"Snippet [ [[<{}>]] <{}> 
    3.32 +
    3.33 +
    3.34 +" Quit if syntax file is already loaded
    3.35 +if version < 600
    3.36 +  syntax clear
    3.37 +elseif exists("b:current_syntax")
    3.38 +  finish
    3.39 +endif
    3.40 +
    3.41 +if version < 508
    3.42 +  command! -nargs=+ WikiHiLink hi link <args>
    3.43 +else
    3.44 +  command! -nargs=+ WikiHiLink hi def link <args>
    3.45 +endif
    3.46 +
    3.47 +syn match   wikiLine        "^----$"
    3.48 +"TODO add different markup for [[link|name]] type of links
    3.49 +syn region  wikiLink        start=+\[\[+hs=s+2 end=+\]\]+he=e-2
    3.50 +syn match   wikiList        "^[*#]* "
    3.51 +syn region  wikiCurly       start="{\{3\}" end="}\{3\}"
    3.52 +syn region  wikiCurly       start="<eucode>" end="</eucode>"
    3.53 +syn region  wikiHead        start="^=" end="$"
    3.54 +"syn region  wikiSubhead     start="^== " end="$"
    3.55 +"TODO add syntax for tables
    3.56 +
    3.57 +"try to not get confused with wikiLink
    3.58 +syn region  wikiBold        start="\*\*[^ ]" end="\*\*"
    3.59 +"try to not get confused with http://
    3.60 +"FIXME does not work at beginning of line
    3.61 +syn region  wikiItalic      start="[^:]\/\/"hs=s+1   end="[^:]\/\/"
    3.62 +syn region  wikiUnderline   start="__" end="__"
    3.63 +"syn region  wikiStrike      start="--" end="--"
    3.64 +"TODO add regions for mixed markup
    3.65 +"syn region wikiBoldItalic   contained start=+\([^']\|^\)''[^']+ end=+[^']''\([^']\|$\)+
    3.66 +"syn region wikiItalicBold   contained start=+'''+ end=+'''+
    3.67 +
    3.68 +" The default highlighting.
    3.69 +if version >= 508 || !exists("did_wiki_syn_inits")
    3.70 +  if version < 508
    3.71 +    let did_wiki_syn_inits = 1
    3.72 +  endif
    3.73 +  
    3.74 +WikiHiLink wikiCurly       Type
    3.75 +WikiHiLink wikiHead        Statement 
    3.76 +"  WikiHiLink wikiSubhead     PreProc
    3.77 +WikiHiLink wikiList        String
    3.78 +WikiHiLink wikiExtLink     Identifier
    3.79 +WikiHiLink wikiLink        Identifier
    3.80 +WikiHiLink wikiLine        PreProc
    3.81 +
    3.82 +hi def     wikiBold        term=bold cterm=bold gui=bold
    3.83 + " hi def     wikiBoldItalic  term=bold,italic cterm=bold,italic gui=bold,italic
    3.84 +hi def     wikiItalic      term=italic cterm=italic gui=italic
    3.85 + " hi def     wikiItalicBold  term=bold,italic cterm=bold,italic gui=bold,italic
    3.86 +hi def  wikiUnderline   term=underline cterm=underline gui=underline
    3.87 +"hi def wikiStrike ???
    3.88 +
    3.89 +endif
    3.90 +
    3.91 +delcommand WikiHiLink
    3.92 +  
    3.93 +let b:current_syntax = "creole"
    3.94 +
    3.95 +"EOF vim: tw=78:ft=vim:ts=8
    3.96 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/vim/syntax/euphoria.vim	Sat Aug 29 16:11:17 2009 +0000
     4.3 @@ -0,0 +1,110 @@
     4.4 +" Vim syntax file
     4.5 +" 
     4.6 +" Language:	Euphoria
     4.7 +" Maintainer:	Jeremy Cowgar <jeremy@cowgar.com>
     4.8 +" Last Change:	2009-08-29
     4.9 +"
    4.10 +" Install:
    4.11 +"
    4.12 +" Add something like the following to your ~/.vim/filetype.vim
    4.13 +"
    4.14 +" augroup filetypedetect
    4.15 +"   au! BufRead,BufNewFile *.e, *.ex, *.exw, *.eu, *.exu setfiletype euphoria
    4.16 +" augroup END
    4.17 +" 
    4.18 +" Notes:
    4.19 +" 
    4.20 +" For version 5.x: Clear all syntax items
    4.21 +" For version 6.x: Quit when a syntax file was already loaded
    4.22 +if version < 600
    4.23 +	syntax clear
    4.24 +elseif exists("b:current_syntax")
    4.25 +	finish
    4.26 +endif
    4.27 +
    4.28 +" Euphoria Pre-processor words
    4.29 +syn keyword euphoriaPre                elsedef elsifdef ifdef include namespace trace with without
    4.30 +
    4.31 +" Euphoria Scope
    4.32 +syn keyword euphoriaScope              export public global override
    4.33 +
    4.34 +" Euphoria Keywords
    4.35 +syn keyword euphoriaKeywords	       as and
    4.36 +syn keyword euphoriaKeywords	       break by
    4.37 +syn keyword euphoriaKeywords	       case constant continue
    4.38 +syn keyword euphoriaKeywords	       do
    4.39 +syn keyword euphoriaKeywords	       end else elsif exit entry
    4.40 +syn keyword euphoriaKeywords	       for function
    4.41 +syn keyword euphoriaKeywords	       global goto
    4.42 +syn keyword euphoriaKeywords	       if 
    4.43 +syn keyword euphoriaKeywords           label loop
    4.44 +syn keyword euphoriaKeywords	       not
    4.45 +syn keyword euphoriaKeywords	       or
    4.46 +syn keyword euphoriaKeywords	       procedure
    4.47 +syn keyword euphoriaKeywords	       return retry
    4.48 +syn keyword euphoriaKeywords	       switch
    4.49 +syn keyword euphoriaKeywords	       then type to
    4.50 +syn keyword euphoriaKeywords	       until
    4.51 +syn keyword euphoriaKeywords	       while
    4.52 +syn keyword euphoriaKeywords	       xor
    4.53 +
    4.54 +" Types
    4.55 +syn keyword euphoriaTypes	       object sequence integer atom enum
    4.56 +
    4.57 +" Constants
    4.58 +syn match euphoriaConstant "\<[A-Z_][A-Z0-9_]*\>"
    4.59 +
    4.60 +" Various number methods
    4.61 +syn match euphoriaNumber	"\<[_0-9]\+\>"
    4.62 +syn match euphoriaNumber	"\<[_0-9]\+\.[_0-9]*\>"
    4.63 +syn match euphoriaNumber	"\.[_0-9]\+\>"
    4.64 +syn match euphoriaNumber    "\(#\|0x\)[A-Fa-f0-9_]\+\>"
    4.65 +syn match euphoriaNumber    "\<0b[01]\+\>"
    4.66 +syn match euphoriaNumber    "\<0t[0-7]\+\>"
    4.67 +syn match euphoriaNumber    "\<0d[0-9]\+\>"
    4.68 +
    4.69 +" String and Character constants
    4.70 +syn region euphoriaString matchgroup=Normal start=+'+ end=+'+ skip=+\\\\\|\\'+ contains=@Spell
    4.71 +syn region euphoriaString matchgroup=Normal start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=@Spell
    4.72 +syn region euphoriaString matchgroup=Normal start=+`+ end=+`+ contains=@Spell
    4.73 +syn region euphoriaString matchgroup=Normal start=+"""+ end=+"""+ contains=@Spell
    4.74 +
    4.75 +" Todo (only highlighted in comments)
    4.76 +syn keyword euphoriaTodo contained	TODO FIXME XXX
    4.77 +
    4.78 +syn region euphoriaComment oneline contains=euphoriaTodo,@Spell start="--" end="$"
    4.79 +syn region euphoriaComment contains=euphoriaTodo,@Spell start="/\*" end="\*/"
    4.80 +
    4.81 +" Operator
    4.82 +syn match euphoriaOperator   "=\|&\|[!:\[\]\(\)\{\}<>+\*^\\]"
    4.83 +
    4.84 +" Define the default highlighting.
    4.85 +" For version 5.7 and earlier: only when not done already
    4.86 +" For version 5.8 and later: only when an item doesn't have highlighting yet
    4.87 +if version >= 508 || !exists("did_euphoria_syntax_inits")
    4.88 +	if version < 508
    4.89 +		let did_euphoria_syntax_inits = 1
    4.90 +		command -nargs=+ HiLink hi link <args>
    4.91 +	else
    4.92 +		command -nargs=+ HiLink hi def link <args>
    4.93 +	endif
    4.94 +	
    4.95 +	HiLink euphoriaPre              PreProc
    4.96 +	HiLink euphoriaScope            Special
    4.97 +	HiLink euphoriaKeywords			Keyword
    4.98 +	HiLink euphoriaNumber			Number
    4.99 +	HiLink euphoriaComment			Comment
   4.100 +	HiLink euphoriaConstant         Constant
   4.101 +	HiLink euphoriaString			String
   4.102 +	HiLink euphoriaOperator			Operator
   4.103 +	HiLink euphoriaTypes			Type
   4.104 +	HiLink euphoriaTodo				ToDo
   4.105 +	HiLink euphoriaDocSection       Constant
   4.106 +	
   4.107 +	delcommand HiLink
   4.108 +endif
   4.109 +
   4.110 +let b:current_syntax = "euphoria"
   4.111 +
   4.112 +" vim: ts=4
   4.113 +

SCM Home | OpenEuphoria.org Home