# HG changeset patch # User Steve Losh # Date 1308614630 14400 # Node ID 67a6999a73d0982623159dad457caa43b047f144 # Parent 496c5c177a4c1b1a7031fc6cee47875e752c5f24 Switch to SLIMV for Clojure. diff -r 496c5c177a4c -r 67a6999a73d0 vim/.vimrc --- a/vim/.vimrc Mon Jun 20 18:56:33 2011 -0400 +++ b/vim/.vimrc Mon Jun 20 20:03:50 2011 -0400 @@ -247,7 +247,8 @@ au FileType clojure compiler clojure " Eval toplevel form, even when you're on the opening paren. -au FileType clojure nmap ee 0;\et +let g:slimv_leader = '\' +let g:slimv_keybindings = 2 " }}} " Confluence {{{ @@ -608,7 +609,7 @@ " }}} " Makegreen {{{ -nnoremap :call MakeGreen('') +nnoremap \| :call MakeGreen('') " }}} " Pydoc {{{ @@ -647,24 +648,27 @@ " SLIMV {{{ " First check if SWANK is bundled with Slimv -let swanks = split( globpath( &runtimepath, 'slime/start-swank.lisp'), '\n' ) +"let swanks = split( globpath( &runtimepath, 'slime/start-swank.lisp'), '\n' ) -if len( swanks ) == 0 - " Try to find SWANK in the standard SLIME installation locations - if exists('g:slimv_windows') - if g:slimv_windows || g:slimv_cygwin - let swanks = split( globpath( 'c:/slime/,c:/*lisp*/slime/,c:/*lisp*/site/lisp/slime/,c:/Program Files/*lisp*/site/lisp/slime/', 'start-swank.lisp' ), '\n' ) - else - let swanks = split( globpath( '/usr/share/common-lisp/source/slime/', 'start-swank.lisp' ), '\n' ) - endif - endif -endif +"if len( swanks ) == 0 + "" Try to find SWANK in the standard SLIME installation locations + "if exists('g:slimv_windows') + "if g:slimv_windows || g:slimv_cygwin + "let swanks = split( globpath( 'c:/slime/,c:/*lisp*/slime/,c:/*lisp*/site/lisp/slime/,c:/Program Files/*lisp*/site/lisp/slime/', 'start-swank.lisp' ), '\n' ) + "else + "let swanks = split( globpath( '/usr/share/common-lisp/source/slime/', 'start-swank.lisp' ), '\n' ) + "endif + "endif +"endif -if len( swanks ) != 0 - let g:slimv_swank_cmd = '! dtach -n /tmp/swank.socket sbcl --load "' . swanks[0] . '"' - let g:slimv_swank_cmd = '! dtach -n /tmp/swank.socket clisp -i "' . swanks[0] . '"' -endif +"if len( swanks ) != 0 + "let g:slimv_swank_cmd = '! dtach -n /tmp/swank.socket sbcl --load "' . swanks[0] . '"' + "let g:slimv_swank_cmd = '! dtach -n /tmp/swank.socket clisp -i "' . swanks[0] . '"' + "let g:slimv_swank_cmd = '! dtach -n /tmp/swank.socket clisp -i "' . swanks[0] . '"' +"endif +let g:slimv_lisp = '"java -cp `lein classpath` clojure.main"' +let g:slimv_repl_split = 4 " }}}} " Threesome {{{ diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/autoload/vimclojure.vim --- a/vim/bundle/vimclojure/autoload/vimclojure.vim Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,983 +0,0 @@ -" Part of Vim filetype plugin for Clojure -" Language: Clojure -" Maintainer: Meikel Brandmeyer - -let s:save_cpo = &cpo -set cpo&vim - -function! vimclojure#WarnDeprecated(old, new) - echohl WarningMsg - echomsg a:old . " is deprecated! Use " . a:new . "!" - echomsg "eg. let " . a:new . " = " - echohl None -endfunction - -" Configuration -if !exists("g:vimclojure#HighlightBuiltins") - if exists("g:clj_highlight_builtins") - call vimclojure#WarnDeprecated("g:clj_highlight_builtins", - \ "vimclojure#HighlightBuiltins") - let vimclojure#HighlightBuiltins = g:clj_highlight_builtins - else - let vimclojure#HighlightBuiltins = 1 - endif -endif - -if exists("g:clj_highlight_contrib") - echohl WarningMsg - echomsg "clj_highlight_contrib is deprecated! It's removed without replacement!" - echohl None -endif - -if !exists("g:vimclojure#DynamicHighlighting") - if exists("g:clj_dynamic_highlighting") - call vimclojure#WarnDeprecated("g:clj_dynamic_highlighting", - \ "vimclojure#DynamicHighlighting") - let vimclojure#DynamicHighlighting = g:clj_dynamic_highlighting - else - let vimclojure#DynamicHighlighting = 0 - endif -endif - -if !exists("g:vimclojure#ParenRainbow") - if exists("g:clj_paren_rainbow") - call vimclojure#WarnDeprecated("g:clj_paren_rainbow", - \ "vimclojure#ParenRainbow") - let vimclojure#ParenRainbow = g:clj_paren_rainbow - else - let vimclojure#ParenRainbow = 0 - endif -endif - -if !exists("g:vimclojure#WantNailgun") - if exists("g:clj_want_gorilla") - call vimclojure#WarnDeprecated("g:clj_want_gorilla", - \ "vimclojure#WantNailgun") - let vimclojure#WantNailgun = g:clj_want_gorilla - else - let vimclojure#WantNailgun = 0 - endif -endif - -if !exists("g:vimclojure#UseErrorBuffer") - let vimclojure#UseErrorBuffer = 1 -endif - -function! vimclojure#ReportError(msg) - if g:vimclojure#UseErrorBuffer - let buf = g:vimclojure#ResultBuffer.New() - call buf.showText(a:msg) - wincmd p - else - echoerr substitute(a:msg, '\n\(\t\?\)', ' ', 'g') - endif -endfunction - -function! vimclojure#SynIdName() - return synIDattr(synID(line("."), col("."), 0), "name") -endfunction - -function! vimclojure#WithSaved(closure) - let v = a:closure.get(a:closure.tosafe) - try - let r = a:closure.f() - finally - call a:closure.set(a:closure.tosafe, v) - endtry - return r -endfunction - -function! vimclojure#WithSavedPosition(closure) - let a:closure['tosafe'] = "." - let a:closure['get'] = function("getpos") - let a:closure['set'] = function("setpos") - return vimclojure#WithSaved(a:closure) -endfunction - -function! vimclojure#WithSavedRegister(closure) - let a:closure['get'] = function("getreg") - let a:closure['set'] = function("setreg") - return vimclojure#WithSaved(a:closure) -endfunction - -function! vimclojure#WithSavedOption(closure) - function a:closure.get(option) - execute "let val = &" . a:option - return val - endfunction - - function a:closure.set(option, value) - execute "let &" . a:option . " = a:value" - endfunction - - return vimclojure#WithSaved(a:closure) -endfunction - -function! vimclojure#Yank(r, how) - let closure = {'tosafe': a:r, 'yank': a:how} - - function closure.f() dict - silent execute self.yank - return getreg(self.tosafe) - endfunction - - return vimclojure#WithSavedRegister(closure) -endfunction - -function! vimclojure#EscapePathForOption(path) - let path = fnameescape(a:path) - - " Hardcore escapeing of whitespace... - let path = substitute(path, '\', '\\\\', 'g') - let path = substitute(path, '\ ', '\\ ', 'g') - - return path -endfunction - -function! vimclojure#AddPathToOption(path, option) - let path = vimclojure#EscapePathForOption(a:path) - execute "setlocal " . a:option . "+=" . path -endfunction - -function! vimclojure#AddCompletions(ns) - let completions = split(globpath(&rtp, "ftplugin/clojure/completions-" . a:ns . ".txt"), '\n') - if completions != [] - call vimclojure#AddPathToOption('k' . completions[0], 'complete') - endif -endfunction - -" Nailgun part: -function! vimclojure#ExtractSexpr(toplevel) - let closure = { "flag" : (a:toplevel ? "r" : "") } - - function closure.f() dict - if searchpairpos('(', '', ')', 'bW' . self.flag, - \ 'vimclojure#SynIdName() !~ "clojureParen\\d"') != [0, 0] - return vimclojure#Yank('l', 'normal! "ly%') - end - return "" - endfunction - - return vimclojure#WithSavedPosition(closure) -endfunction - -function! vimclojure#BufferName() - let file = expand("%") - if file == "" - let file = "UNNAMED" - endif - return file -endfunction - -" Key mappings and Plugs -function! vimclojure#MakePlug(mode, plug, f, args) - execute a:mode . "noremap Clojure" . a:plug - \ . " :call " . a:f . "(" . a:args . ")" -endfunction - -function! vimclojure#MakeProtectedPlug(mode, plug, f, args) - execute a:mode . "noremap Clojure" . a:plug - \ . " :call vimclojure#ProtectedPlug(function(\"" - \ . a:f . "\"), [ " . a:args . " ])" -endfunction - -function! vimclojure#MapPlug(mode, keys, plug) - if !hasmapto("Clojure" . a:plug) - execute a:mode . "map " . a:keys - \ . " Clojure" . a:plug - endif -endfunction - -function! vimclojure#MapCommandPlug(mode, keys, plug) - if exists("b:vimclojure_namespace") - call vimclojure#MapPlug(a:mode, a:keys, a:plug) - elseif g:vimclojure#WantNailgun == 1 - let msg = ':call vimclojure#ReportError("VimClojure could not initialise the server connection.\n' - \ . 'That means you will not be able to use the interactive features.\n' - \ . 'Reasons might be that the server is not running or that there is\n' - \ . 'some trouble with the classpath.\n\n' - \ . 'VimClojure will *not* start the server for you or handle the classpath.\n' - \ . 'There is a plethora of tools like ivy, maven, gradle and leiningen,\n' - \ . 'which do this better than VimClojure could ever do it.")' - execute a:mode . "map " . a:keys - \ . " " . msg . "" - endif -endfunction - -if !exists("*vimclojure#ProtectedPlug") - function vimclojure#ProtectedPlug(f, args) - try - return call(a:f, a:args) - catch /.*/ - call vimclojure#ReportError(v:exception) - endtry - endfunction -endif - -" A Buffer... -if !exists("g:vimclojure#SplitPos") - let vimclojure#SplitPos = "top" -endif - -if !exists("g:vimclojure#SplitSize") - let vimclojure#SplitSize = "" -endif - -let vimclojure#Buffer = {} - -function! vimclojure#Buffer.New() dict - let instance = copy(self) - - call self.MakeBuffer() - call self.Init(instance) - - return instance -endfunction - -function! vimclojure#Buffer.MakeBuffer() - if g:vimclojure#SplitPos == "left" || g:vimclojure#SplitPos == "right" - let o_sr = &splitright - if g:vimclojure#SplitPos == "left" - set nosplitright - else - set splitright - end - execute printf("%svnew", g:vimclojure#SplitSize) - let &splitright = o_sr - else - let o_sb = &splitbelow - if g:vimclojure#SplitPos == "bottom" - set splitbelow - else - set nosplitbelow - end - execute printf("%snew", g:vimclojure#SplitSize) - let &splitbelow = o_sb - endif -endfunction - -function! vimclojure#Buffer.Init(instance) - let a:instance._buffer = bufnr("%") -endfunction - -function! vimclojure#Buffer.goHere() dict - execute "buffer! " . self._buffer -endfunction - -function! vimclojure#Buffer.goHereWindow() dict - execute "sbuffer! " . self._buffer -endfunction - -function! vimclojure#Buffer.resize() dict - call self.goHere() - let size = line("$") - if size < 3 - let size = 3 - endif - execute "resize " . size -endfunction - -function! vimclojure#Buffer.showText(text) dict - call self.goHere() - if type(a:text) == type("") - let text = split(a:text, '\n') - else - let text = a:text - endif - call append(line("$"), text) -endfunction - -function! vimclojure#Buffer.showOutput(output) dict - call self.goHere() - if a:output.value == 0 - if a:output.stdout != "" - call self.showText(a:output.stdout) - endif - if a:output.stderr != "" - call self.showText(a:output.stderr) - endif - else - call self.showText(a:output.value) - endif -endfunction - -function! vimclojure#Buffer.clear() dict - 1 - normal! "_dG -endfunction - -function! vimclojure#Buffer.close() dict - execute "bdelete! " . self._buffer -endfunction - -" The transient buffer, used to display results. -let vimclojure#ResultBuffer = copy(vimclojure#Buffer) -let vimclojure#ResultBuffer["__superBufferInit"] = vimclojure#ResultBuffer["Init"] -let vimclojure#ResultBuffer.__instance = [] - -function! vimclojure#ResultBuffer.New() dict - if g:vimclojure#ResultBuffer.__instance != [] - let closure = { - \ 'instance' : g:vimclojure#ResultBuffer.__instance[0], - \ 'tosafe' : 'switchbuf', - \ 'class' : self - \ } - function closure.f() dict - set switchbuf=useopen - call self.instance.goHereWindow() - call self.instance.clear() - return self.class.Init(self.instance) - endfunction - - return vimclojure#WithSavedOption(closure) - endif - - let instance = copy(self) - let g:vimclojure#ResultBuffer.__instance = [ instance ] - - call g:vimclojure#Buffer.MakeBuffer() - call self.__superBufferInit(instance) - call self.Init(instance) - - return instance -endfunction - -function! vimclojure#ResultBuffer.Init(instance) dict - setlocal noswapfile - setlocal buftype=nofile - setlocal bufhidden=wipe - - call vimclojure#MapPlug("n", "p", "CloseResultBuffer") - - call a:instance.clear() - let leader = exists("g:maplocalleader") ? g:maplocalleader : "\\" - call append(0, "; Use " . leader . "p to close this buffer!") - - return a:instance -endfunction - -function! vimclojure#ResultBuffer.CloseBuffer() dict - if g:vimclojure#ResultBuffer.__instance != [] - let instance = g:vimclojure#ResultBuffer.__instance[0] - let g:vimclojure#ResultBuffer.__instance = [] - call instance.close() - endif -endfunction - -function! s:InvalidateResultBufferIfNecessary(buf) - if g:vimclojure#ResultBuffer.__instance != [] - \ && g:vimclojure#ResultBuffer.__instance[0]._buffer == a:buf - let g:vimclojure#ResultBuffer.__instance = [] - endif -endfunction - -augroup VimClojureResultBuffer - au BufDelete * call s:InvalidateResultBufferIfNecessary(expand("")) -augroup END - -" A special result buffer for clojure output. -let vimclojure#ClojureResultBuffer = copy(vimclojure#ResultBuffer) -let vimclojure#ClojureResultBuffer["__superResultBufferInit"] = - \ vimclojure#ResultBuffer["Init"] -let vimclojure#ClojureResultBuffer["__superResultBufferShowOutput"] = - \ vimclojure#ResultBuffer["showOutput"] - -function! vimclojure#ClojureResultBuffer.Init(instance) dict - call self.__superResultBufferInit(a:instance) - setfiletype clojure - - return a:instance -endfunction - -function! vimclojure#ClojureResultBuffer.showOutput(text) dict - call self.__superResultBufferShowOutput(a:text) - normal G -endfunction - -" Nails -if !exists("vimclojure#NailgunClient") - let vimclojure#NailgunClient = "ng" -endif - -function! vimclojure#ShellEscapeArguments(vals) - let closure = { 'vals': a:vals, 'tosafe': 'shellslash' } - - function closure.f() dict - set noshellslash - return map(copy(self.vals), 'shellescape(v:val)') - endfunction - - return vimclojure#WithSavedOption(closure) -endfunction - -function! vimclojure#ExecuteNailWithInput(nail, input, ...) - if type(a:input) == type("") - let input = split(a:input, '\n', 1) - else - let input = a:input - endif - - let inputfile = tempname() - try - call writefile(input, inputfile) - - let cmdline = vimclojure#ShellEscapeArguments( - \ [g:vimclojure#NailgunClient, "vimclojure.Nail", a:nail] - \ + a:000) - let cmd = join(cmdline, " ") . " <" . inputfile - " Add hardcore quoting for Windows - if has("win32") || has("win64") - let cmd = '"' . cmd . '"' - endif - - let output = system(cmd) - - if v:shell_error - throw "Error executing Nail! (" . v:shell_error . ")\n" . output - endif - finally - call delete(inputfile) - endtry - - execute "let result = " . substitute(output, '\n$', '', '') - return result -endfunction - -function! vimclojure#ExecuteNail(nail, ...) - return call(function("vimclojure#ExecuteNailWithInput"), [a:nail, ""] + a:000) -endfunction - -function! vimclojure#FilterNail(nail, rngStart, rngEnd, ...) - let cmdline = [g:vimclojure#NailgunClient, - \ "vimclojure.Nail", a:nail] - \ + vimclojure#ShellEscapeArguments(a:000) - let cmd = a:rngStart . "," . a:rngEnd . "!" . join(cmdline, " ") - - silent execute cmd -endfunction - -function! vimclojure#DocLookup(word) - if a:word == "" - return - endif - - let doc = vimclojure#ExecuteNailWithInput("DocLookup", a:word, - \ "-n", b:vimclojure_namespace) - let buf = g:vimclojure#ResultBuffer.New() - call buf.showOutput(doc) - wincmd p -endfunction - -function! vimclojure#FindDoc() - let pattern = input("Pattern to look for: ") - let doc = vimclojure#ExecuteNailWithInput("FindDoc", pattern) - let buf = g:vimclojure#ResultBuffer.New() - call buf.showOutput(doc) - wincmd p -endfunction - -let s:DefaultJavadocPaths = { - \ "java" : "http://java.sun.com/javase/6/docs/api/", - \ "org/apache/commons/beanutils" : "http://commons.apache.org/beanutils/api/", - \ "org/apache/commons/chain" : "http://commons.apache.org/chain/api-release/", - \ "org/apache/commons/cli" : "http://commons.apache.org/cli/api-release/", - \ "org/apache/commons/codec" : "http://commons.apache.org/codec/api-release/", - \ "org/apache/commons/collections" : "http://commons.apache.org/collections/api-release/", - \ "org/apache/commons/logging" : "http://commons.apache.org/logging/apidocs/", - \ "org/apache/commons/mail" : "http://commons.apache.org/email/api-release/", - \ "org/apache/commons/io" : "http://commons.apache.org/io/api-release/" - \ } - -if !exists("vimclojure#JavadocPathMap") - let vimclojure#JavadocPathMap = {} -endif - -for k in keys(s:DefaultJavadocPaths) - if !has_key(vimclojure#JavadocPathMap, k) - let vimclojure#JavadocPathMap[k] = s:DefaultJavadocPaths[k] - endif -endfor - -if !exists("vimclojure#Browser") - if has("win32") || has("win64") - let vimclojure#Browser = "start" - elseif has("mac") - let vimclojure#Browser = "open" - else - let vimclojure#Browser = "firefox -new-window" - endif -endif - -function! vimclojure#JavadocLookup(word) - let word = substitute(a:word, "\\.$", "", "") - let path = vimclojure#ExecuteNailWithInput("JavadocPath", word, - \ "-n", b:vimclojure_namespace) - - if path.stderr != "" - let buf = g:vimclojure#ResultBuffer.New() - call buf.showOutput(path) - wincmd p - return - endif - - let match = "" - for pattern in keys(g:vimclojure#JavadocPathMap) - if path.value =~ "^" . pattern && len(match) < len(pattern) - let match = pattern - endif - endfor - - if match == "" - echoerr "No matching Javadoc URL found for " . path.value - endif - - let url = g:vimclojure#JavadocPathMap[match] . path.value - call system(join([g:vimclojure#Browser, url], " ")) -endfunction - -function! vimclojure#SourceLookup(word) - let source = vimclojure#ExecuteNailWithInput("SourceLookup", a:word, - \ "-n", b:vimclojure_namespace) - let buf = g:vimclojure#ClojureResultBuffer.New() - call buf.showOutput(source) - wincmd p -endfunction - -function! vimclojure#MetaLookup(word) - let meta = vimclojure#ExecuteNailWithInput("MetaLookup", a:word, - \ "-n", b:vimclojure_namespace) - let buf = g:vimclojure#ClojureResultBuffer.New() - call buf.showOutput(meta) - wincmd p -endfunction - -function! vimclojure#GotoSource(word) - let pos = vimclojure#ExecuteNailWithInput("SourceLocation", a:word, - \ "-n", b:vimclojure_namespace) - - if pos.stderr != "" - let buf = g:vimclojure#ResultBuffer.New() - call buf.showOutput(pos) - wincmd p - return - endif - - if !filereadable(pos.value.file) - let file = findfile(pos.value.file) - if file == "" - echoerr pos.value.file . " not found in 'path'" - return - endif - let pos.value.file = file - endif - - execute "edit " . pos.value.file - execute pos.value.line -endfunction - -" Evaluators -function! vimclojure#MacroExpand(firstOnly) - let sexp = vimclojure#ExtractSexpr(0) - let ns = b:vimclojure_namespace - - let cmd = ["MacroExpand", sexp, "-n", ns] - if a:firstOnly - let cmd = cmd + [ "-o" ] - endif - - let expanded = call(function("vimclojure#ExecuteNailWithInput"), cmd) - - let buf = g:vimclojure#ClojureResultBuffer.New() - call buf.showOutput(expanded) - wincmd p -endfunction - -function! vimclojure#RequireFile(all) - let ns = b:vimclojure_namespace - let all = a:all ? "-all" : "" - - let require = "(require :reload" . all . " :verbose '". ns. ")" - let result = vimclojure#ExecuteNailWithInput("Repl", require, "-r") - - let resultBuffer = g:vimclojure#ClojureResultBuffer.New() - call resultBuffer.showOutput(result) - wincmd p -endfunction - -function! vimclojure#RunTests(all) - let ns = b:vimclojure_namespace - - let result = call(function("vimclojure#ExecuteNailWithInput"), - \ [ "RunTests", "", "-n", ns ] + (a:all ? [ "-a" ] : [])) - let resultBuffer = g:vimclojure#ClojureResultBuffer.New() - call resultBuffer.showOutput(result) - wincmd p -endfunction - -function! vimclojure#EvalFile() - let content = getbufline(bufnr("%"), 1, line("$")) - let file = vimclojure#BufferName() - let ns = b:vimclojure_namespace - - let result = vimclojure#ExecuteNailWithInput("Repl", content, - \ "-r", "-n", ns, "-f", file) - - let resultBuffer = g:vimclojure#ClojureResultBuffer.New() - call resultBuffer.showOutput(result) - wincmd p -endfunction - -function! vimclojure#EvalLine() - let theLine = line(".") - let content = getline(theLine) - let file = vimclojure#BufferName() - let ns = b:vimclojure_namespace - - let result = vimclojure#ExecuteNailWithInput("Repl", content, - \ "-r", "-n", ns, "-f", file, "-l", theLine) - - let resultBuffer = g:vimclojure#ClojureResultBuffer.New() - call resultBuffer.showOutput(result) - wincmd p -endfunction - -function! vimclojure#EvalBlock() range - let file = vimclojure#BufferName() - let ns = b:vimclojure_namespace - - let content = getbufline(bufnr("%"), a:firstline, a:lastline) - let result = vimclojure#ExecuteNailWithInput("Repl", content, - \ "-r", "-n", ns, "-f", file, "-l", a:firstline - 1) - - let resultBuffer = g:vimclojure#ClojureResultBuffer.New() - call resultBuffer.showOutput(result) - wincmd p -endfunction - -function! vimclojure#EvalToplevel() - let file = vimclojure#BufferName() - let ns = b:vimclojure_namespace - - let pos = searchpairpos('(', '', ')', 'bWnr', - \ 'vimclojure#SynIdName() !~ "clojureParen\\d"') - - if pos == [0, 0] - throw "Error: Not in toplevel expression!" - endif - - let expr = vimclojure#ExtractSexpr(1) - let result = vimclojure#ExecuteNailWithInput("Repl", expr, - \ "-r", "-n", ns, "-f", file, "-l", pos[0] - 1) - - let resultBuffer = g:vimclojure#ClojureResultBuffer.New() - call resultBuffer.showOutput(result) - wincmd p -endfunction - -function! vimclojure#EvalParagraph() - let file = vimclojure#BufferName() - let ns = b:vimclojure_namespace - let startPosition = line(".") - - let closure = {} - - function! closure.f() dict - normal! } - return line(".") - endfunction - - let endPosition = vimclojure#WithSavedPosition(closure) - - let content = getbufline(bufnr("%"), startPosition, endPosition) - let result = vimclojure#ExecuteNailWithInput("Repl", content, - \ "-r", "-n", ns, "-f", file, "-l", startPosition - 1) - - let resultBuffer = g:vimclojure#ClojureResultBuffer.New() - call resultBuffer.showOutput(result) - wincmd p -endfunction - -" The Repl -let vimclojure#Repl = copy(vimclojure#Buffer) -let vimclojure#Repl.__superBufferInit = vimclojure#Repl.Init - -let vimclojure#Repl._history = [] -let vimclojure#Repl._historyDepth = 0 -let vimclojure#Repl._replCommands = [ ",close", ",st", ",ct", ",toggle-pprint" ] - -" Simple wrapper to allow on demand load of autoload/vimclojure.vim. -function! vimclojure#StartRepl(...) - let ns = a:0 > 0 ? a:1 : "user" - call g:vimclojure#Repl.New(ns) -endfunction - -function! vimclojure#Repl.New(namespace) dict - let instance = copy(self) - - call g:vimclojure#Buffer.MakeBuffer() - call self.Init(instance, a:namespace) - - return instance -endfunction - -function! vimclojure#Repl.Init(instance, namespace) dict - call self.__superBufferInit(a:instance) - - let a:instance._prompt = a:namespace . "=>" - - setlocal buftype=nofile - setlocal noswapfile - - call append(line("$"), ["Clojure", a:instance._prompt . " "]) - - let replStart = vimclojure#ExecuteNail("Repl", "-s", - \ "-n", a:namespace) - let a:instance._id = replStart.value.id - call vimclojure#ExecuteNailWithInput("Repl", - \ "(require 'clojure.stacktrace)", - \ "-r", "-i", a:instance._id) - - let b:vimclojure_repl = a:instance - - set filetype=clojure - - if !hasmapto("ClojureReplEnterHook") - imap ClojureReplEnterHook - endif - if !hasmapto("ClojureReplUpHistory") - imap ClojureReplUpHistory - endif - if !hasmapto("ClojureReplDownHistory") - imap ClojureReplDownHistory - endif - - normal! G - startinsert! -endfunction - -function! vimclojure#Repl.isReplCommand(cmd) dict - for candidate in self._replCommands - if candidate == a:cmd - return 1 - endif - endfor - return 0 -endfunction - -function! vimclojure#Repl.doReplCommand(cmd) dict - if a:cmd == ",close" - call vimclojure#ExecuteNail("Repl", "-S", "-i", self._id) - call self.close() - stopinsert - elseif a:cmd == ",st" - let result = vimclojure#ExecuteNailWithInput("Repl", - \ "(vimclojure.util/pretty-print-stacktrace *e)", "-r", - \ "-i", self._id) - call self.showOutput(result) - call self.showPrompt() - elseif a:cmd == ",ct" - let result = vimclojure#ExecuteNailWithInput("Repl", - \ "(vimclojure.util/pretty-print-causetrace *e)", "-r", - \ "-i", self._id) - call self.showOutput(result) - call self.showPrompt() - elseif a:cmd == ",toggle-pprint" - let result = vimclojure#ExecuteNailWithInput("Repl", - \ "(set! vimclojure.repl/*print-pretty* (not vimclojure.repl/*print-pretty*))", "-r", - \ "-i", self._id) - call self.showOutput(result) - call self.showPrompt() - endif -endfunction - -function! vimclojure#Repl.showPrompt() dict - call self.showText(self._prompt . " ") - normal! G - startinsert! -endfunction - -function! vimclojure#Repl.getCommand() dict - let ln = line("$") - - while getline(ln) !~ "^" . self._prompt && ln > 0 - let ln = ln - 1 - endwhile - - " Special Case: User deleted Prompt by accident. Insert a new one. - if ln == 0 - call self.showPrompt() - return "" - endif - - let cmd = vimclojure#Yank("l", ln . "," . line("$") . "yank l") - - let cmd = substitute(cmd, "^" . self._prompt . "\\s*", "", "") - let cmd = substitute(cmd, "\n$", "", "") - return cmd -endfunction - -function! vimclojure#Repl.enterHook() dict - let cmd = self.getCommand() - - " Special Case: Showed prompt (or user just hit enter). - if cmd == "" - return - endif - - if self.isReplCommand(cmd) - call self.doReplCommand(cmd) - return - endif - - let result = vimclojure#ExecuteNailWithInput("CheckSyntax", cmd, - \ "-n", b:vimclojure_namespace) - if result.value == 0 && result.stderr == "" - execute "normal! GA\x" - normal! ==x - startinsert! - elseif result.stderr != "" - let buf = g:vimclojure#ResultBuffer.New() - call buf.showOutput(result) - else - let result = vimclojure#ExecuteNailWithInput("Repl", cmd, - \ "-r", "-i", self._id) - call self.showOutput(result) - - let self._historyDepth = 0 - let self._history = [cmd] + self._history - - let namespace = vimclojure#ExecuteNailWithInput("ReplNamespace", "", - \ "-i", self._id) - let b:vimclojure_namespace = namespace.value - let self._prompt = namespace.value . "=>" - - call self.showPrompt() - endif -endfunction - -function! vimclojure#Repl.upHistory() dict - let histLen = len(self._history) - let histDepth = self._historyDepth - - if histLen > 0 && histLen > histDepth - let cmd = self._history[histDepth] - let self._historyDepth = histDepth + 1 - - call self.deleteLast() - - call self.showText(self._prompt . " " . cmd) - endif - - normal! G$ -endfunction - -function! vimclojure#Repl.downHistory() dict - let histLen = len(self._history) - let histDepth = self._historyDepth - - if histDepth > 0 && histLen > 0 - let self._historyDepth = histDepth - 1 - let cmd = self._history[self._historyDepth] - - call self.deleteLast() - - call self.showText(self._prompt . " " . cmd) - elseif histDepth == 0 - call self.deleteLast() - call self.showText(self._prompt . " ") - endif - - normal! G$ -endfunction - -function! vimclojure#Repl.deleteLast() dict - normal! G - - while getline("$") !~ self._prompt - normal! dd - endwhile - - normal! dd -endfunction - -" Highlighting -function! vimclojure#ColorNamespace(highlights) - for [category, words] in items(a:highlights) - if words != [] - execute "syntax keyword clojure" . category . " " . join(words, " ") - endif - endfor -endfunction - -" Omni Completion -function! vimclojure#OmniCompletion(findstart, base) - if a:findstart == 1 - let line = getline(".") - let start = col(".") - 1 - - while start > 0 && line[start - 1] =~ '\w\|-\|\.\|+\|*\|/' - let start -= 1 - endwhile - - return start - else - let slash = stridx(a:base, '/') - if slash > -1 - let prefix = strpart(a:base, 0, slash) - let base = strpart(a:base, slash + 1) - else - let prefix = "" - let base = a:base - endif - - if prefix == "" && base == "" - return [] - endif - - let completions = vimclojure#ExecuteNail("Complete", - \ "-n", b:vimclojure_namespace, - \ "-p", prefix, "-b", base) - return completions.value - endif -endfunction - -function! vimclojure#InitBuffer() - if exists("b:vimclojure_loaded") - return - endif - let b:vimclojure_loaded = 1 - - if g:vimclojure#WantNailgun == 1 - if !exists("b:vimclojure_namespace") - " Get the namespace of the buffer. - if &previewwindow - let b:vimclojure_namespace = "user" - else - try - let content = getbufline(bufnr("%"), 1, line("$")) - let namespace = - \ vimclojure#ExecuteNailWithInput( - \ "NamespaceOfFile", content) - if namespace.stderr != "" - throw namespace.stderr - endif - let b:vimclojure_namespace = namespace.value - catch /.*/ - call vimclojure#ReportError( - \ "Could not determine the Namespace of the file.\n\n" - \ . "This might have different reasons. Please check, that the ng server\n" - \ . "is running with the correct classpath and that the file does not contain\n" - \ . "syntax errors. The interactive features will not be enabled, ie. the\n" - \ . "keybindings will not be mapped.\n\nReason:\n" . v:exception) - endtry - endif - endif - endif -endfunction - -function! vimclojure#AddToLispWords(word) - execute "setlocal lw+=" . a:word -endfunction - -" Epilog -let &cpo = s:save_cpo diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/bin/clj --- a/vim/bundle/vimclojure/bin/clj Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -#!/bin/bash - -# Copyright (c) Stephen C. Gilardi. All rights reserved. The use and -# distribution terms for this software are covered by the Eclipse Public -# License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be -# found in the file epl-v10.html at the root of this distribution. By -# using this software in any fashion, you are agreeing to be bound by the -# terms of this license. You must not remove this notice, or any other, -# from this software. -# -# clj-env-dir Launches Clojure, passing along command line arguments. This -# launcher can be configured using environment variables and -# makes it easy to include directories full of classpath roots -# in CLASSPATH. -# -# scgilardi (gmail) -# Created 7 January 2009 -# -# Modified to read in an optional .clojure file in the current directory -# naming further items for the CLASSPATH. -# -# Meikel Brandmeyer (mb ? kotka ! de) -# Frankfurt am Main, 21.08.2009 -# -# Environment variables (optional): -# -# CLOJURE_EXT Colon-delimited list of paths to directories whose top-level -# contents are (either directly or as symbolic links) jar -# files and/or directories whose paths will be in Clojure's -# classpath. The value of the CLASSPATH environment variable -# for Clojure will include these top-level paths followed by -# the previous value of CLASSPATH (if any). -# default: -# example: /usr/local/share/clojure/ext:$HOME/.clojure.d/ext -# -# CLOJURE_JAVA The command to launch a JVM instance for Clojure -# default: java -# example: /usr/local/bin/java6 -# -# CLOJURE_OPTS Java options for this JVM instance -# default: -# example:"-Xms32M -Xmx128M -server" -# -# CLOJURE_MAIN The Java class to launch -# default: clojure.main -# example: clojure.contrib.repl_ln - -set -o errexit -#set -o nounset -#set -o xtrace - -if [ -n "${CLOJURE_EXT:-}" ]; then - OLD="$IFS" - IFS=":" - EXT="$(find -H ${CLOJURE_EXT} -mindepth 1 -maxdepth 1 -print0 | tr \\0 \:)" - IFS="$OLD" - if [ -n "${CLASSPATH:-}" ]; then - CLASSPATH="${EXT}${CLASSPATH}" - else - CLASSPATH="${EXT%:}" - fi -fi - -if [ -f .clojure ]; then - for path in `cat .clojure`; do - if [ -n "${CLASSPATH:-}" ]; then - CLASSPATH="${path}:${CLASSPATH}" - else - CLASSPATH="${path%:}" - fi - done -fi - -export CLASSPATH - -JAVA=${CLOJURE_JAVA:-java} -OPTS=${CLOJURE_OPTS:-} -MAIN=${CLOJURE_MAIN:-clojure.main} - -exec ${JAVA} ${OPTS} ${MAIN} "$@" diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/bin/clj.bat --- a/vim/bundle/vimclojure/bin/clj.bat Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -@ECHO OFF - -REM # Copyright (c) Stephen C. Gilardi. All rights reserved. The use and -REM # distribution terms for this software are covered by the Eclipse Public -REM # License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be -REM # found in the file epl-v10.html at the root of this distribution. By -REM # using this software in any fashion, you are agreeing to be bound by the -REM # terms of this license. You must not remove this notice, or any other, -REM # from this software. -REM # -REM # scgilardi (gmail) -REM # Created 7 January 2009 -REM # -REM # Modified by Justin Johnson to run on Windows -REM # and to include a check for .clojure file in the current directory. -REM # -REM # Environment variables: -REM # -REM # Optional: -REM # -REM # CLOJURE_EXT The path to a directory containing (either directly or as -REM # symbolic links) jar files and/or directories whose paths -REM # should be in Clojure's classpath. The value of the -REM # CLASSPATH environment variable for Clojure will be a list -REM # of these paths followed by the previous value of CLASSPATH -REM # (if any). -REM # -REM # CLOJURE_JAVA The command to launch a JVM instance for Clojure -REM # default: java -REM # example: /usr/local/bin/java6 -REM # -REM # CLOJURE_OPTS Java options for this JVM instance -REM # default: -REM # example:"-Xms32M -Xmx128M -server" -REM # -REM # Configuration files: -REM # -REM # Optional: -REM # -REM # .clojure A file sitting in the directory where you invoke ng-server. -REM # Each line contains a single path that should be added to the classpath. -REM # - -SETLOCAL ENABLEDELAYEDEXPANSION - -REM # Add all jar files from CLOJURE_EXT directory to classpath -IF DEFINED CLOJURE_EXT FOR %%E IN ("%CLOJURE_EXT%\*") DO SET CP=!CP!;%%~fE - -IF NOT DEFINED CLOJURE_JAVA SET CLOJURE_JAVA=java - -REM # If the current directory has a .clojure file in it, add each path -REM # in the file to the classpath. -IF EXIST .clojure FOR /F %%E IN (.clojure) DO SET CP=!CP!;%%~fE - -%CLOJURE_JAVA% %CLOJURE_OPTS% -cp "%CP%" clojure.main %1 %2 %3 %4 %5 %6 %7 %8 %9 diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/bin/kickoff.sh --- a/vim/bundle/vimclojure/bin/kickoff.sh Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -#! /usr/bin/env bash - -GRADLE_REV="0.8" -GRADLE_URL="http://dist.codehaus.org/gradle/gradle-${GRADLE_REV}-bin.zip" -GRADLE_ZIP="gradle.zip" -GRADLE_DIR="gradle-${GRADLE_REV}" - -PLUGIN_REV="1.3.0" -PLUGIN_URL="http://clojars.org/repo/clojuresque/clojuresque/${PLUGIN_REV}/clojuresque-${PLUGIN_REV}.jar" -PLUGIN_JAR="clojuresque-${PLUGIN_REV}.jar" - -CACHE_DIR="cache" -CACHE_GRADLE_ZIP="${CACHE_DIR}/${GRADLE_ZIP}" -CACHE_GRADLE_DIR="${CACHE_DIR}/${GRADLE_DIR}" - -if [ ! -e "${CACHE_DIR}" ]; then - mkdir "${CACHE_DIR}" -fi - -if [ ! -e "${CACHE_GRADLE_ZIP}" ]; then - wget ${GRADLE_URL} -O "${CACHE_GRADLE_ZIP}" -fi - -if [ ! -e "${CACHE_GRADLE_DIR}" ]; then - pushd . - cd "${CACHE_DIR}" - unzip "${GRADLE_ZIP}" - popd -fi - -if [ ! -e "${CACHE_PLUGIN_DIR}" ]; then - wget ${PLUGIN_URL} -O "${CACHE_GRADLE_DIR}/lib/${PLUGIN_JAR}" -fi - -echo "clojure=clojuresque.ClojurePlugin" >> "${CACHE_GRADLE_DIR}/plugin.properties" - -echo "Don't forget to set GRADLE_HOME!" -echo "export GRADLE_HOME=\"${CACHE_GRADLE_DIR}\"" diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/bin/ng Binary file vim/bundle/vimclojure/bin/ng has changed diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/bin/ng-server --- a/vim/bundle/vimclojure/bin/ng-server Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -#! /usr/bin/env bash - -# Copyright (c) Stephen C. Gilardi. All rights reserved. The use and -# distribution terms for this software are covered by the Eclipse Public -# License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be -# found in the file epl-v10.html at the root of this distribution. By -# using this software in any fashion, you are agreeing to be bound by the -# terms of this license. You must not remove this notice, or any other, -# from this software. -# -# clj-env-dir Launches Clojure, passing along command line arguments. This -# launcher can be configured using environment variables and -# makes it easy to include directories full of classpath roots -# in CLASSPATH. -# -# scgilardi (gmail) -# Created 7 January 2009 -# -# Modified to act as launcher for the Nailgun server and to read in an -# optional .clojure file in the current directory naming further items -# for the CLASSPATH. -# -# Meikel Brandmeyer (mb ? kotka ! de) -# Frankfurt am Main, 21.08.2009 -# -# Environment variables (optional): -# -# CLOJURE_EXT Colon-delimited list of paths to directories whose top-level -# contents are (either directly or as symbolic links) jar -# files and/or directories whose paths will be in Clojure's -# classpath. The value of the CLASSPATH environment variable -# for Clojure will include these top-level paths followed by -# the previous value of CLASSPATH (if any). -# default: -# example: /usr/local/share/clojure/ext:$HOME/.clojure.d/ext -# -# CLOJURE_JAVA The command to launch a JVM instance for Clojure -# default: java -# example: /usr/local/bin/java6 -# -# CLOJURE_OPTS Java options for this JVM instance -# default: -# example:"-Xms32M -Xmx128M -server" -# -# .clojure A file in the current directory. Every line names an item -# which will be added to the CLASSPATH. - -set -o errexit -#set -o nounset -#set -o xtrace - -if [ -n "${CLOJURE_EXT:-}" ]; then - OLD="$IFS" - IFS=":" - EXT="$(find -H ${CLOJURE_EXT} -mindepth 1 -maxdepth 1 -print0 | tr \\0 \:)" - IFS="$OLD" - if [ -n "${CLASSPATH:-}" ]; then - export CLASSPATH="${EXT}${CLASSPATH}" - else - export CLASSPATH="${EXT%:}" - fi -fi - -if [ -f .clojure ]; then - for path in `cat .clojure`; do - if [ -n "${CLASSPATH:-}" ]; then - export CLASSPATH="${path}:${CLASSPATH}" - else - export CLASSPATH="${path%:}" - fi - done -fi - -JAVA=${CLOJURE_JAVA:-java} -OPTS=${CLOJURE_OPTS:-} - -exec ${JAVA} ${OPTS} vimclojure.nailgun.NGServer 127.0.0.1 "$@" diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/bin/ng-server.bat --- a/vim/bundle/vimclojure/bin/ng-server.bat Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -@ECHO OFF - -REM # Copyright (c) Stephen C. Gilardi. All rights reserved. The use and -REM # distribution terms for this software are covered by the Eclipse Public -REM # License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can be -REM # found in the file epl-v10.html at the root of this distribution. By -REM # using this software in any fashion, you are agreeing to be bound by the -REM # terms of this license. You must not remove this notice, or any other, -REM # from this software. -REM # -REM # scgilardi (gmail) -REM # Created 7 January 2009 -REM # -REM # Modified by Justin Johnson to act as Windows -REM # launcher for the Nailgun server of VimClojure, and to include a check for -REM # a .clojure file in the current directory. -REM # -REM # Environment variables: -REM # -REM # Optional: -REM # -REM # CLOJURE_EXT The path to a directory containing (either directly or as -REM # symbolic links) jar files and/or directories whose paths -REM # should be in Clojure's classpath. The value of the -REM # CLASSPATH environment variable for Clojure will be a list -REM # of these paths followed by the previous value of CLASSPATH -REM # (if any). -REM # -REM # CLOJURE_JAVA The command to launch a JVM instance for Clojure -REM # default: java -REM # example: /usr/local/bin/java6 -REM # -REM # CLOJURE_OPTS Java options for this JVM instance -REM # default: -REM # example:"-Xms32M -Xmx128M -server" -REM # -REM # Configuration files: -REM # -REM # Optional: -REM # -REM # .clojure A file sitting in the directory where you invoke ng-server. -REM # Each line contains a single path that should be added to the classpath. -REM # - -SETLOCAL ENABLEDELAYEDEXPANSION - -REM # Add all jar files from CLOJURE_EXT directory to classpath -IF DEFINED CLOJURE_EXT FOR %%E IN ("%CLOJURE_EXT%\*") DO SET CP=!CP!;%%~fE - -IF NOT DEFINED CLOJURE_JAVA SET CLOJURE_JAVA=java - -REM # If the current directory has a .clojure file in it, add each path -REM # in the file to the classpath. -IF EXIST .clojure FOR /F %%E IN (.clojure) DO SET CP=!CP!;%%~fE - -REM # Since we do not provide any security we at least bind only to the loopback. -%CLOJURE_JAVA% %CLOJURE_OPTS% -cp "%CP%" vimclojure.nailgun.NGServer 127.0.0.1 %1 %2 %3 %4 %5 %6 %7 %8 %9 diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/doc/clojure.txt --- a/vim/bundle/vimclojure/doc/clojure.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,343 +0,0 @@ -*vimclojure.txt* *clojure.vim* - -VimClojure - A Clojure Environment -================================== - -Introduction ------------- - -VimClojure is a filetype plugin and development environment for Clojure. It -provides indenting, syntax highlighting and – if configured – interactive -features like omni completion, documentation lookup and a Repl running in a -Vim buffer. - -Nailgun Server *clj-nailgun-server* --------------- - -To use the interactive part you have to start the nailgun server via the jar -file. Make sure, that clojure and clojure-contrib are in your classpath and -start the vimclojure.nailgun.NGServer class. Example invocation: -> - java -cp clojure.jar:clojure-contrib.jar:vimclojure.jar vimclojure.nailgun.NGServer 127.0.0.1 -< -This may look different depending on your system. - -You can stop the server by invoking the nailgun client with the ng-stop -argument. -> - ng ng-stop -< -Set the vimclojure#WantNailgun variable in your vimrc. -> - let vimclojure#WantNailgun = 1 -< -Note: Should there be an error when executing an interactive command -and the error message goes away to quickly, you can use |:messages| to -recall the message and read it conveniently without time pressure. - -VimClojure might pop up windows, like the preview window or the Repl. -The place where this is done may be controlled with the SplitPos variable. -Possible values are "left", "right", "top" and "bottom". The default is -"top". - -Example: -> - let vimclojure#SplitPos = "left" -< -It is also possible to specify the size of the new window. The size is -specified in lines/columns. -> - let vimclojure#SplitSize = 10 -< - -Errors ------- - -Errors are reported in a temporary buffer. This is to make error messages -more readable. In particular when they contain stacktraces from the Java -side. However this may interfer with scripts which do not expect that a -new buffer pops up. So one can go back to the old behaviour. -> - let vimclojure#UseErrorBuffer = 0 -< -Note: the error might not be shown by vim. Check the output of |:message| -for errors. - -Syntax Highlighting *ft-clj-syntax* -------------------- - -The clojure syntax highlighting provides several options: -> - g:vimclojure#HighlightBuiltins - If it is nonzero, then Clojure's builtin functions are - highlighted. This useful to distuingish macros and special - forms from functions. Enabled by default. - - g:vimclojure#ParenRainbow - Controls the colorisation of the differing levels of - parenthesisation. If non-zero, different levels will be - colored differently. Disabled by default. - - g:vimclojure#DynamicHighlighting - Uses the dynamic features of VimClojure to dynamically add - the symbols of required and used namespaces. The file needs - to be correct (ie. w/o syntax errors and on the classpath) - for this to work. If this is not the case, dynamic - highlighting is not done. Disabled by default. -< -The g:vimclojure#ParenRainbow option provides 10 levels of individual -colorisation for the parentheses. Because of the quantity of colorisation -levels, unlike non-rainbow highlighting, the rainbow mode specifies its -highlighting using ctermfg and guifg, thereby bypassing the usual colorscheme -control using standard highlighting groups. The actual highlighting used -depends on the dark/bright setting (see |'bg'|). - -Preview Window --------------- - -Many of the below mentioned commands open the so called preview window. -It displays information obtained from the lookup functions and the omni -completion. You may close the preview window with p. - -Note: The preview window sometimes doesn't not adhere to the SplitPos -variable. This is the case, eg. for omni completion. It happens when -the preview window is created by Vim and not by VimClojure itself. At -the moment, I don't know how to fix this. - -Keybindings ------------ - -Note: is a Vim feature. More information can be found -under the |maplocalleader| help topic. - -You can redefine any key mapping using some autocommand in your .vimrc file. -All mappings use so-called Plugs. Simply prepend Clojure to the given -Plug name and your setting will override the default mapping. -> - aucmd BufRead,BufNewFile *.clj nmap xyz ClojureEvalToplevel -< - -et *et* *EvalToplevel* - Send off the toplevel sexpression currently - containing the cursor to the Clojure server. - -ef *ef* *EvalFile* - Send off the current file to the Clojure Server. - -eb *eb* *EvalBlock* - Send off the the mark visual block to the - Clojure server. Obviously this mapping is only - active in visual mode. - Note: This does not check for structure. - -el *el* *EvalLine* - Send off the current line to the Clojure Server. - Note: This does not check for structure. - -ep *ep* *EvalParagraph* - Send off the current paragraph to the Clojure Server. - Note: This does not check for structure. - -rf *rf* *RequireFile* - Require the namespace of the current file with - the :reload flag. Note: For this to work with - a remote Clojure server, the files have to put in - place before issueing the command, eg. via scp - or NFS. - -rF *rF* *RequireFileAll* - Require the namespace of the current file with - the :reload-all flag. Note: For this to work with - a remote Clojure server, the files have to put in - place before issueing the command, eg. via scp - or NFS. - -rt *rt* *RunTests* - Require the namespace of the filename with the - :reload flag. Then use clojure.contrib.test-is - to run the tests of the namespace via run-tests. - Note: For this to work with a remote Clojure - server, the files have to put in place before - issueing the command, eg. via scp or NFS. - -me *me* *MacroExpand* - Expand the innermost sexpression currently - containing the cursor using macroexpand. - -m1 *m1* *MacroExpand1* - Same as MacroExpand, but use macroexpand-1. - - -lw *lw* *DocLookupWord* - Lookup up the word under the cursor and print - the documentation for it via (doc). - -li *li* *DocLookupInteractive* - Lookup the documentation of an arbitrary word. - The user is prompted for input. - -fd *fd* *FindDoc* - Find a the documentation for a given pattern - with (find-doc). The user is prompted for input. - -jw *jw* *JavadocLookupWord* - Open the javadoc for the word under the cursor - in an external browser. - -ji *ji* *JavadocLookupInteractive* - Open the javadoc for an arbitrary word in an - external browser. The user is prompted for input. - -sw *sw* *SourceLookupWord* - Show a read-only view of the source the word under - the cursor. For this to work, the source must be - available in the Classpath or as a file (depending - on how the source was loaded). - -si *si* *SourceLookupInteractive* - Show a read-only view of the source of an arbitrary - word. For this to work, the source must be available - in the Classpath or as a file (depending on how the - source was loaded). - -gw *gw* *GotoSourceWord* - Goto the source of the word under the cursor. For this - to work, the source must be available in a directory - of the |'path'| option. The directories in the - CLOJURE_SOURCE_DIRS environment variable will be added - to the |'path'| setting. - -gi *gi* *GotoSourceInteractive* - Goto the source of an arbitrary word. For this to work, - the source must be available in a directory of the - |'path'| option. The directories in the - CLOJURE_SOURCE_DIRS environment variable will be added - to the |'path'| setting. - -mw *mw* *MetaLookupWord* - Lookup the meta data of the word under the cursor. - -mi *mi* *MetaLookupInteractive* - Lookup the meta data of an arbitrary word. The - user is prompted for input. - -sr *sr* *StartRepl* - Start a new Vim Repl in a fresh buffer. There - might be multiple Repls at the same time. - -sR *sR* *StartLocalRepl* - Start a new Vim Repl in a fresh buffer. Initialise - the namespace to be the namespace of the current - buffer. Note: this will 'require' the namespace! - -The following key mappings are also supported if the dynamic features are -turned off. - -aw *aw* *AddToLispWords* - Add the word under the cursor to the lispwords option - of the buffer. This modifies the way the form is - indented. - -Vim Repl --------- - -Start a Repl via the |sr| shortcut. At the prompt just type expressions. -Hitting enter will determine, whether the expression is complete and -will send it to the Clojure instance. In case the expression is incomplete, -eg. after "(defn foo" will result in a newline for multiline expressions. - -Previously sent expressions may be recalled via and . -Note: sending multiple expressions will save them in the same history -entry. So playing back with will again send all of the contained -expressions. - -The Plugs are: - - ClojureReplEnterHook for the enter key - - ClojureReplUpHistory for going backwards in history () - - ClojureReplDownHistory for going forwards in history () - -The following convenience commands are provided: - - - ,close - close the Repl and free the Repl resources in the server process - - ,st - print a stack trace of *e as with clojure.contrib.stacktrace - - ,ct - print a cause trace of *e as with clojure.contrib.stacktrace - - ,toggle-pprint - toggle pretty-printing of evaluated values - -You can also start a Repl with the :ClojureRepl command. This command works -regardless of the type of the current buffer, while the shortcuts only work in -Clojure buffers. - -Pretty Printing ---------------- - -In case Tom Faulhaber's cl-format package is available in the Classpath -it will be used for pretty printing, eg. of macroexpansions. The Repl -can be told to use pretty printing via a global Var. -> - (set! vimclojure.repl/*print-pretty* true) -< - -Omni Completion ---------------- - -VimClojure supports omni completion for Clojure code. Hitting in -insert mode will try to provide completions for the item in front of the -cursor. - -The completion tries to be somewhat intelligent in what it completes. - - - a word starting with an upper case letter will be completed to an - imported class. - Str => String, StringBuilder, ... - - - a word containing dots will be completed to a namespace. - c.c => clojure.core, clojure.contrib.repl-utils, ... - - - everything else will be completed to a Var, an alias or namespace. - - - a word containing a slash will be handled differently - - if the word starts with an upper case letter, will complete - static fields of the given class - String/va => String/valueOf - - - otherwise it is treated as a namespace or alias - clojure.core/re => clojure.core/read, ... - -The completion uses certain characters to split the matching. This are -hyphens and (for namespaces) dots. So r-s matches read-string. - -Note: Completion of symbols and keywords is also provided via the -functionality of Vim. - -Known Issues ------------- - -There seems to be a race condition in nailgun. At the moment there is -no solution to this problem. In case you get errors with valid looking -input for vim, please contact me. - -License -------- - -Copyright (c) 2008,2009,2010 Meikel Brandmeyer, Frankfurt am Main -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -============================================================================== -.. vim: set ft=help norl ts=8 tw=78 et : diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftdetect/clojure.vim --- a/vim/bundle/vimclojure/ftdetect/clojure.vim Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -au BufNewFile,BufRead *.clj set filetype=clojure diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure.vim --- a/vim/bundle/vimclojure/ftplugin/clojure.vim Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -" Vim filetype plugin file -" Language: Clojure -" Maintainer: Meikel Brandmeyer - -" Only do this when not done yet for this buffer -if exists("b:did_ftplugin") - finish -endif - -let b:did_ftplugin = 1 - -let s:cpo_save = &cpo -set cpo&vim - -let b:undo_ftplugin = "setlocal fo< com< cms< cpt< isk< def<" - -setlocal iskeyword+=?,-,*,!,+,/,=,<,>,.,: - -setlocal define=^\\s*(def\\(-\\|n\\|n-\\|macro\\|struct\\|multi\\)? - -" Set 'formatoptions' to break comment lines but not other lines, -" and insert the comment leader when hitting or using "o". -setlocal formatoptions-=t formatoptions+=croql -setlocal commentstring=;%s - -" Set 'comments' to format dashed lists in comments. -setlocal comments=sO:;\ -,mO:;\ \ ,n:; - -" Take all directories of the CLOJURE_SOURCE_DIRS environment variable -" and add them to the path option. -if has("win32") || has("win64") - let s:delim = ";" -else - let s:delim = ":" -endif -for dir in split($CLOJURE_SOURCE_DIRS, s:delim) - call vimclojure#AddPathToOption(dir . "/**", 'path') -endfor - -" When the matchit plugin is loaded, this makes the % command skip parens and -" braces in comments. -let b:match_words = &matchpairs -let b:match_skip = 's:comment\|string\|character' - -" Win32 can filter files in the browse dialog -if has("gui_win32") && !exists("b:browsefilter") - let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" . - \ "Jave Source Files (*.java)\t*.java\n" . - \ "All Files (*.*)\t*.*\n" -endif - -for ns in [ "clojure.core", "clojure.inspector", "clojure.java.browse", - \ "clojure.java.io", "clojure.java.javadoc", "clojure.java.shell", - \ "clojure.main", "clojure.pprint", "clojure.repl", "clojure.set", - \ "clojure.stacktrace", "clojure.string", "clojure.template", - \ "clojure.test", "clojure.test.tap", "clojure.test.junit", - \ "clojure.walk", "clojure.xml", "clojure.zip" ] - call vimclojure#AddCompletions(ns) -endfor - -" Define toplevel folding if desired. -function! ClojureGetFoldingLevel(lineno) - let closure = { 'lineno' : a:lineno } - - function closure.f() dict - execute self.lineno - - if vimclojure#SynIdName() =~ 'clojureParen\d' && vimclojure#Yank('l', 'normal! "lyl') == '(' - return 1 - endif - - if searchpairpos('(', '', ')', 'bWr', 'vimclojure#SynIdName() !~ "clojureParen\\d"') != [0, 0] - return 1 - endif - - return 0 - endfunction - - return vimclojure#WithSavedPosition(closure) -endfunction - -" Disabled for now. Too slow (and naive). -if exists("g:clj_want_folding") && g:clj_want_folding == 1 && 0 == 1 - setlocal foldexpr=ClojureGetFoldingLevel(v:lnum) - setlocal foldmethod=expr -endif - -try - call vimclojure#InitBuffer() -catch /.*/ - " We swallow a failure here. It means most likely that the - " server is not running. - echohl WarningMsg - echomsg v:exception - echohl None -endtry - -call vimclojure#MapPlug("n", "aw", "AddToLispWords") - -call vimclojure#MapCommandPlug("n", "lw", "DocLookupWord") -call vimclojure#MapCommandPlug("n", "li", "DocLookupInteractive") -call vimclojure#MapCommandPlug("n", "jw", "JavadocLookupWord") -call vimclojure#MapCommandPlug("n", "ji", "JavadocLookupInteractive") -call vimclojure#MapCommandPlug("n", "fd", "FindDoc") - -call vimclojure#MapCommandPlug("n", "mw", "MetaLookupWord") -call vimclojure#MapCommandPlug("n", "mi", "MetaLookupInteractive") - -call vimclojure#MapCommandPlug("n", "sw", "SourceLookupWord") -call vimclojure#MapCommandPlug("n", "si", "SourceLookupInteractive") - -call vimclojure#MapCommandPlug("n", "gw", "GotoSourceWord") -call vimclojure#MapCommandPlug("n", "gi", "GotoSourceInteractive") - -call vimclojure#MapCommandPlug("n", "rf", "RequireFile") -call vimclojure#MapCommandPlug("n", "rF", "RequireFileAll") - -call vimclojure#MapCommandPlug("n", "rt", "RunTests") - -call vimclojure#MapCommandPlug("n", "me", "MacroExpand") -call vimclojure#MapCommandPlug("n", "m1", "MacroExpand1") - -call vimclojure#MapCommandPlug("n", "ef", "EvalFile") -call vimclojure#MapCommandPlug("n", "el", "EvalLine") -call vimclojure#MapCommandPlug("v", "eb", "EvalBlock") -call vimclojure#MapCommandPlug("n", "et", "EvalToplevel") -call vimclojure#MapCommandPlug("n", "ep", "EvalParagraph") - -call vimclojure#MapCommandPlug("n", "sr", "StartRepl") -call vimclojure#MapCommandPlug("n", "sR", "StartLocalRepl") - -if exists("b:vimclojure_namespace") - setlocal omnifunc=vimclojure#OmniCompletion - - augroup VimClojure - autocmd CursorMovedI if pumvisible() == 0 | pclose | endif - augroup END -endif - -call vimclojure#MapPlug("n", "p", "CloseResultBuffer") - -let &cpo = s:cpo_save diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.core.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.core.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,526 +0,0 @@ -*agent* -*allow-unresolved-vars* -*assert* -*clojure-version* -*command-line-args* -*compile-files* -*compile-path* -*err* -*file* -*flush-on-newline* -*in* -*math-context* -*ns* -*out* -*print-dup* -*print-length* -*print-level* -*print-meta* -*print-readably* -*read-eval* -*source-path* -*use-context-classloader* -*warn-on-reflection* -->> --cache-protocol-fn --reset-methods -EMPTY-NODE -accessor -aclone -add-classpath -add-watch -agent -agent-error -agent-errors -aget -alength -alias -all-ns -alter -alter-meta! -alter-var-root -amap -ancestors -and -apply -areduce -array-map -aset -aset-boolean -aset-byte -aset-char -aset-double -aset-float -aset-int -aset-long -aset-short -assert -assoc -assoc! -assoc-in -associative? -atom -await -await-for -await1 -bases -bean -bigdec -bigint -binding -bit-and -bit-and-not -bit-clear -bit-flip -bit-not -bit-or -bit-set -bit-shift-left -bit-shift-right -bit-test -bit-xor -boolean -boolean-array -booleans -bound-fn -bound-fn* -bound? -butlast -byte -byte-array -bytes -case -cast -char -char-array -char-escape-string -char-name-string -char? -chars -chunk -chunk-append -chunk-buffer -chunk-cons -chunk-first -chunk-next -chunk-rest -chunked-seq? -class -class? -clear-agent-errors -clojure-version -coll? -comment -commute -comp -comparator -compare -compare-and-set! -compile -complement -concat -cond -condp -conj -conj! -cons -constantly -construct-proxy -contains? -count -counted? -create-ns -create-struct -cycle -dec -decimal? -declare -definline -definterface -defmacro -defmethod -defmulti -defn -defn- -defonce -defprotocol -defrecord -defstruct -deftype -delay -delay? -deliver -denominator -deref -derive -descendants -destructure -disj -disj! -dissoc -dissoc! -distinct -distinct? -doall -doc -dorun -doseq -dosync -dotimes -doto -double -double-array -doubles -drop -drop-last -drop-while -empty -empty? -ensure -enumeration-seq -error-handler -error-mode -eval -even? -every? -extend -extend-protocol -extend-type -extenders -extends? -false? -ffirst -file-seq -filter -find -find-doc -find-ns -find-protocol-impl -find-protocol-method -find-var -first -flatten -float -float-array -float? -floats -flush -fn? -fnext -fnil -for -force -format -frequencies -future -future-call -future-cancel -future-cancelled? -future-done? -future? -gen-class -gen-interface -gensym -get -get-in -get-method -get-proxy-class -get-thread-bindings -get-validator -group-by -hash -hash-combine -hash-map -hash-set -identical? -identity -if-let -if-not -ifn? -import -in-ns -inc -init-proxy -instance? -int -int-array -integer? -interleave -intern -interpose -into -into-array -ints -io! -isa? -iterate -iterator-seq -juxt -keep -keep-indexed -key -keys -keyword -keyword? -last -lazy-cat -lazy-seq -let -letfn -line-seq -list -list* -list? -load -load-file -load-reader -load-string -loaded-libs -locking -long -long-array -longs -loop -macroexpand -macroexpand-1 -make-array -make-hierarchy -map -map-indexed -map? -mapcat -max -max-key -memfn -memoize -merge -merge-with -meta -method-sig -methods -min -min-key -mod -munge -name -namespace -namespace-munge -neg? -newline -next -nfirst -nil? -nnext -not -not-any? -not-empty -not-every? -not= -ns-aliases -ns-imports -ns-interns -ns-map -ns-name -ns-publics -ns-refers -ns-resolve -ns-unalias -ns-unmap -nth -nthnext -num -number? -numerator -object-array -odd? -parents -partial -partition -partition-all -partition-by -pcalls -peek -persistent! -pmap -pop -pop! -pop-thread-bindings -pos? -pr-str -prefer-method -prefers -primitives-classnames -print -print-ctor -print-doc -print-dup -print-method -print-namespace-doc -print-simple -print-special-doc -print-str -printf -println -println-str -prn -prn-str -promise -proxy -proxy-call-with-super -proxy-mappings -proxy-name -proxy-super -push-thread-bindings -pvalues -quot -rand -rand-int -rand-nth -range -ratio? -rational? -rationalize -re-find -re-groups -re-matcher -re-matches -re-pattern -re-seq -read -read-line -read-string -reduce -reductions -ref -ref-history-count -ref-max-history -ref-min-history -ref-set -refer -refer-clojure -reify -release-pending-sends -rem -remove -remove-all-methods -remove-method -remove-ns -remove-watch -repeat -repeatedly -replace -replicate -require -reset! -reset-meta! -resolve -rest -restart-agent -resultset-seq -reverse -reversible? -rseq -rsubseq -satisfies? -second -select-keys -send -send-off -seq -seq? -seque -sequence -sequential? -set -set-error-handler! -set-error-mode! -set-validator! -set? -short -short-array -shorts -shuffle -shutdown-agents -slurp -some -sort -sort-by -sorted-map -sorted-map-by -sorted-set -sorted-set-by -sorted? -special-form-anchor -special-symbol? -spit -split-at -split-with -str -string? -struct -struct-map -subs -subseq -subvec -supers -swap! -symbol -symbol? -sync -syntax-symbol-anchor -take -take-last -take-nth -take-while -test -the-ns -thread-bound? -time -to-array -to-array-2d -trampoline -transient -tree-seq -true? -type -unchecked-add -unchecked-dec -unchecked-divide -unchecked-inc -unchecked-multiply -unchecked-negate -unchecked-remainder -unchecked-subtract -underive -unquote -unquote-splicing -update-in -update-proxy -use -val -vals -var-get -var-set -var? -vary-meta -vec -vector -vector-of -vector? -when -when-first -when-let -when-not -while -with-bindings -with-bindings* -with-in-str -with-loading-context -with-local-vars -with-meta -with-open -with-out-str -with-precision -xml-seq -zero? -zipmap diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.inspector.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.inspector.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -atom? -collection-tag -get-child -get-child-count -inspect -inspect-table -inspect-tree -is-leaf -list-model -list-provider -old-table-model -table-model -tree-model diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.browse.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.browse.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -*open-url-script* -browse-url diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.io.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.io.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -Coercions -IOFactory -as-file -as-relative-path -as-url -copy -default-streams-impl -delete-file -file -input-stream -make-input-stream -make-output-stream -make-parents -make-reader -make-writer -output-stream -reader -resource -writer diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.javadoc.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.javadoc.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -*core-java-api* -*feeling-lucky* -*feeling-lucky-url* -*local-javadocs* -*remote-javadocs* -add-local-javadoc -add-remote-javadoc -javadoc diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.shell.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.shell.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -*sh-dir* -*sh-env* -with-sh-dir -with-sh-env diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.main.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.main.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -load-script -main -repl -repl-caught -repl-exception -repl-prompt -repl-read -skip-if-eol -skip-whitespace -with-bindings diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.pprint.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.pprint.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -*print-base* -*print-miser-width* -*print-pprint-dispatch* -*print-pretty* -*print-radix* -*print-right-margin* -*print-suppress-namespaces* -cl-format -code-dispatch -formatter -formatter-out -fresh-line -get-pretty-writer -pprint -pprint-indent -pprint-logical-block -pprint-newline -pprint-tab -set-pprint-dispatch -simple-dispatch -with-pprint-dispatch -write -write-out diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.repl.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.repl.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -apropos -dir -dir-fn -source -source-fn diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.set.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.set.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -difference -index -intersection -join -map-invert -project -rename -rename-keys -select -subset? -superset? -union diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.stacktrace.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.stacktrace.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -print-cause-trace -print-stack-trace -print-throwable -print-trace-element -root-cause diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.string.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.string.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -blank? -capitalize -escape -join -lower-case -replace -replace-first -reverse -split -split-lines -trim -trim-newline -triml -trimr -upper-case diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.template.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.template.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -apply-template -do-template diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.test.junit.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.test.junit.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -*depth* -*var-context* -element-content -error-el -failure-el -finish-case -finish-element -finish-suite -indent -junit-report -message-el -package-class -start-case -start-element -start-suite -suite-attrs -test-name -with-junit-output diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.test.tap.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.test.tap.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -print-tap-diagnostic -print-tap-fail -print-tap-pass -print-tap-plan -tap-report -with-tap-output diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.test.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.test.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -*initial-report-counters* -*load-tests* -*report-counters* -*stack-trace-depth* -*test-out* -*testing-contexts* -*testing-vars* -are -assert-any -assert-expr -assert-predicate -compose-fixtures -deftest -deftest- -file-position -function? -get-possibly-unbound-var -inc-report-counter -join-fixtures -report -run-all-tests -run-tests -set-test -successful? -test-all-vars -test-ns -test-var -testing -testing-contexts-str -testing-vars-str -try-expr -use-fixtures -with-test -with-test-out diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.walk.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.walk.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -keywordize-keys -macroexpand-all -postwalk -postwalk-demo -postwalk-replace -prewalk -prewalk-demo -prewalk-replace -stringify-keys -walk diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.xml.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.xml.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -*current* -*sb* -*stack* -*state* -attrs -content -content-handler -element -emit -emit-element -parse -startparse-sax -tag diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.zip.txt --- a/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.zip.txt Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -append-child -branch? -children -down -edit -end? -insert-child -insert-left -insert-right -left -leftmost -lefts -make-node -next -node -path -prev -remove -replace -right -rightmost -rights -root -seq-zip -vector-zip -xml-zip -zipper diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/indent/clojure.vim --- a/vim/bundle/vimclojure/indent/clojure.vim Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,208 +0,0 @@ -" Vim indent file -" Language: Clojure -" Maintainer: Meikel Brandmeyer -" URL: http://kotka.de/projects/clojure/vimclojure.html - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -let s:save_cpo = &cpo -set cpo&vim - -let b:undo_indent = "setlocal ai< si< lw< et< sts< sw< inde< indk<" - -setlocal autoindent expandtab nosmartindent - -setlocal softtabstop=2 -setlocal shiftwidth=2 - -setlocal indentkeys=!,o,O - -if exists("*searchpairpos") - -function! s:MatchPairs(open, close, stopat) - " Stop only on vector and map [ resp. {. Ignore the ones in strings and - " comments. - return searchpairpos(a:open, '', a:close, 'bWn', - \ 'vimclojure#SynIdName() !~ "clojureParen\\d"', - \ a:stopat) -endfunction - -function! VimClojureCheckForStringWorker() - " Check whether there is the last character of the previous line is - " highlighted as a string. If so, we check whether it's a ". In this - " case we have to check also the previous character. The " might be the - " closing one. In case the we are still in the string, we search for the - " opening ". If this is not found we take the indent of the line. - let nb = prevnonblank(v:lnum - 1) - - if nb == 0 - return -1 - endif - - call cursor(nb, 0) - call cursor(0, col("$") - 1) - if vimclojure#SynIdName() != "clojureString" - return -1 - endif - - " This will not work for a " in the first column... - if vimclojure#Yank('l', 'normal! "lyl') == '"' - call cursor(0, col("$") - 2) - if vimclojure#SynIdName() != "clojureString" - return -1 - endif - if vimclojure#Yank('l', 'normal! "lyl') != '\\' - return -1 - endif - call cursor(0, col("$") - 1) - endif - - let p = searchpos('\(^\|[^\\]\)\zs"', 'bW') - - if p != [0, 0] - return p[1] - 1 - endif - - return indent(".") -endfunction - -function! VimClojureCheckForString() - return vimclojure#WithSavedPosition({'f': function("VimClojureCheckForStringWorker")}) -endfunction - -function! GetClojureIndent() - " Get rid of special case. - if line(".") == 1 - return 0 - endif - - " We have to apply some heuristics here to figure out, whether to use - " normal lisp indenting or not. - let i = VimClojureCheckForString() - if i > -1 - return i - endif - - call cursor(0, 1) - - " Find the next enclosing [ or {. We can limit the second search - " to the line, where the [ was found. If no [ was there this is - " zero and we search for an enclosing {. - let paren = s:MatchPairs('(', ')', 0) - let bracket = s:MatchPairs('\[', '\]', paren[0]) - let curly = s:MatchPairs('{', '}', bracket[0]) - - " In case the curly brace is on a line later then the [ or - in - " case they are on the same line - in a higher column, we take the - " curly indent. - if curly[0] > bracket[0] || curly[1] > bracket[1] - if curly[0] > paren[0] || curly[1] > paren[1] - return curly[1] - endif - endif - - " If the curly was not chosen, we take the bracket indent - if - " there was one. - if bracket[0] > paren[0] || bracket[1] > paren[1] - return bracket[1] - endif - - " There are neither { nor [ nor (, ie. we are at the toplevel. - if paren == [0, 0] - return 0 - endif - - " Now we have to reimplement lispindent. This is surprisingly easy, as - " soon as one has access to syntax items. - " - " - Get the next keyword after the (. - " - If its first character is also a (, we have another sexp and align - " one column to the right of the unmatched (. - " - In case it is in lispwords, we indent the next line to the column of - " the ( + sw. - " - If not, we check whether it is last word in the line. In that case - " we again use ( + sw for indent. - " - In any other case we use the column of the end of the word + 2. - call cursor(paren[0] , paren[1]) - - " In case we are at the last character, we use the paren position. - if col("$") - 1 == paren[1] - return paren[1] - endif - - " In case after the paren is a whitespace, we search for the next word. - normal! l - let reg = getreg("l") - normal! "lyl - if getreg("l") == ' ' - normal! w - endif - call setreg("l", reg) - - " If we moved to another line, there is no word after the (. We - " use the ( position for indent. - if line(".") > paren[0] - return paren[1] - endif - - " We still have to check, whether the keyword starts with a (, [ or {. - " In that case we use the ( position for indent. - let reg = getreg("l") - normal! "lye - let w = getreg("l") - call setreg("l", reg) - if stridx('([{', w[0]) > 0 - return paren[1] - endif - - if &lispwords =~ '\<' . w . '\>' - return paren[1] + &shiftwidth - 1 - endif - - normal! w - if paren[0] < line(".") - return paren[1] + &shiftwidth - 1 - endif - - normal! ge - return col(".") + 1 -endfunction - -setlocal indentexpr=GetClojureIndent() - -else - - " In case we have searchpairpos not available we fall back to - " normal lisp indenting. - setlocal indentexpr= - setlocal lisp - let b:undo_indent .= " lisp<" - -endif - -" Defintions: -setlocal lispwords=def,def-,defn,defn-,defmacro,defmacro-,defmethod,defmulti -setlocal lispwords+=defonce,defvar,defvar-,defunbound,let,fn,letfn,binding,proxy -setlocal lispwords+=defnk,definterface,defprotocol,deftype,defrecord,reify -setlocal lispwords+=extend,extend-protocol,extend-type,bound-fn - -" Conditionals and Loops: -setlocal lispwords+=if,if-not,if-let,when,when-not,when-let,when-first -setlocal lispwords+=condp,case,loop,dotimes,for,while - -" Blocks: -setlocal lispwords+=do,doto,try,catch,locking,with-in-str,with-out-str,with-open -setlocal lispwords+=dosync,with-local-vars,doseq,dorun,doall,->,->>,future -setlocal lispwords+=with-bindings - -" Namespaces: -setlocal lispwords+=ns,clojure.core/ns - -" Java Classes: -setlocal lispwords+=gen-class,gen-interface - -let &cpo = s:save_cpo diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/plugin/clojure.vim --- a/vim/bundle/vimclojure/plugin/clojure.vim Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -" Vim filetype plugin file -" Language: Clojure -" Maintainer: Meikel Brandmeyer - -" Only do this when not done yet for this buffer -if exists("clojure_loaded") - finish -endif - -let clojure_loaded = "2.2.0-SNAPSHOT" - -let s:cpo_save = &cpo -set cpo&vim - -command! -nargs=0 ClojureRepl call vimclojure#StartRepl() - -call vimclojure#MakeProtectedPlug("n", "AddToLispWords", "vimclojure#AddToLispWords", "expand(\"\")") - -call vimclojure#MakeProtectedPlug("n", "DocLookupWord", "vimclojure#DocLookup", "expand(\"\")") -call vimclojure#MakeProtectedPlug("n", "DocLookupInteractive", "vimclojure#DocLookup", "input(\"Symbol to look up: \")") -call vimclojure#MakeProtectedPlug("n", "JavadocLookupWord", "vimclojure#JavadocLookup", "expand(\"\")") -call vimclojure#MakeProtectedPlug("n", "JavadocLookupInteractive", "vimclojure#JavadocLookup", "input(\"Class to lookup: \")") -call vimclojure#MakeProtectedPlug("n", "FindDoc", "vimclojure#FindDoc", "") - -call vimclojure#MakeProtectedPlug("n", "MetaLookupWord", "vimclojure#MetaLookup", "expand(\"\")") -call vimclojure#MakeProtectedPlug("n", "MetaLookupInteractive", "vimclojure#MetaLookup", "input(\"Symbol to look up: \")") - -call vimclojure#MakeProtectedPlug("n", "SourceLookupWord", "vimclojure#SourceLookup", "expand(\"\")") -call vimclojure#MakeProtectedPlug("n", "SourceLookupInteractive", "vimclojure#SourceLookup", "input(\"Symbol to look up: \")") - -call vimclojure#MakeProtectedPlug("n", "GotoSourceWord", "vimclojure#GotoSource", "expand(\"\")") -call vimclojure#MakeProtectedPlug("n", "GotoSourceInteractive", "vimclojure#GotoSource", "input(\"Symbol to go to: \")") - -call vimclojure#MakeProtectedPlug("n", "RequireFile", "vimclojure#RequireFile", "0") -call vimclojure#MakeProtectedPlug("n", "RequireFileAll", "vimclojure#RequireFile", "1") - -call vimclojure#MakeProtectedPlug("n", "RunTests", "vimclojure#RunTests", "0") - -call vimclojure#MakeProtectedPlug("n", "MacroExpand", "vimclojure#MacroExpand", "0") -call vimclojure#MakeProtectedPlug("n", "MacroExpand1", "vimclojure#MacroExpand", "1") - -call vimclojure#MakeProtectedPlug("n", "EvalFile", "vimclojure#EvalFile", "") -call vimclojure#MakeProtectedPlug("n", "EvalLine", "vimclojure#EvalLine", "") -call vimclojure#MakeProtectedPlug("v", "EvalBlock", "vimclojure#EvalBlock", "") -call vimclojure#MakeProtectedPlug("n", "EvalToplevel", "vimclojure#EvalToplevel", "") -call vimclojure#MakeProtectedPlug("n", "EvalParagraph", "vimclojure#EvalParagraph", "") - -call vimclojure#MakeProtectedPlug("n", "StartRepl", "vimclojure#StartRepl", "") -call vimclojure#MakeProtectedPlug("n", "StartLocalRepl", "vimclojure#StartRepl", "b:vimclojure_namespace") - -inoremap ClojureReplEnterHook :call b:vimclojure_repl.enterHook() -inoremap ClojureReplUpHistory :call b:vimclojure_repl.upHistory() -inoremap ClojureReplDownHistory :call b:vimclojure_repl.downHistory() - -nnoremap ClojureCloseResultBuffer :call vimclojure#ResultBuffer.CloseBuffer() - -let &cpo = s:cpo_save diff -r 496c5c177a4c -r 67a6999a73d0 vim/bundle/vimclojure/syntax/clojure.vim --- a/vim/bundle/vimclojure/syntax/clojure.vim Mon Jun 20 18:56:33 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,300 +0,0 @@ -" Vim syntax file -" Language: Clojure -" Maintainer: Toralf Wittner -" modified by Meikel Brandmeyer -" URL: http://kotka.de/projects/clojure/vimclojure.html - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" Highlight superfluous closing parens, brackets and braces. -syn match clojureError "]\|}\|)" - -" Special case for Windows. -try - call vimclojure#InitBuffer() -catch /.*/ - " We swallow a failure here. It means most likely that the - " server is not running. - echohl WarningMsg - echomsg v:exception - echohl None -endtry - -if g:vimclojure#HighlightBuiltins != 0 - let s:builtins_map = { - \ "Constant": "nil", - \ "Boolean": "true false", - \ "Cond": "if if-not if-let when when-not when-let " - \ . "when-first cond condp case", - \ "Exception": "try catch finally throw", - \ "Repeat": "recur map mapcat reduce filter for doseq dorun " - \ . "doall dotimes map-indexed keep keep-indexed", - \ "Special": ". def do fn if let new quote var loop", - \ "Variable": "*warn-on-reflection* this *assert* " - \ . "*agent* *ns* *in* *out* *err* *command-line-args* " - \ . "*print-meta* *print-readably* *print-length* " - \ . "*allow-unresolved-args* *compile-files* " - \ . "*compile-path* *file* *flush-on-newline* " - \ . "*math-context* *print-dup* " - \ . "*print-level* *use-context-classloader* " - \ . "*source-path* *clojure-version* *read-eval* " - \ . "*1 *2 *3 *e", - \ "Define": "def- defn defn- defmacro defmulti defmethod " - \ . "defstruct defonce declare definline definterface " - \ . "defprotocol defrecord deftype", - \ "Macro": "and or -> assert with-out-str with-in-str with-open " - \ . "locking destructure ns dosync binding delay " - \ . "lazy-cons lazy-cat time assert doc with-precision " - \ . "with-local-vars .. doto memfn proxy amap areduce " - \ . "refer-clojure future lazy-seq letfn " - \ . "with-loading-context bound-fn extend extend-protocol " - \ . "extend-type reify with-bindings ->>", - \ "Func": "= not= not nil? false? true? complement identical? " - \ . "string? symbol? map? seq? vector? keyword? var? " - \ . "special-symbol? apply partial comp constantly " - \ . "identity comparator fn? re-matcher re-find re-matches " - \ . "re-groups re-seq re-pattern str pr prn print " - \ . "println pr-str prn-str print-str println-str newline " - \ . "macroexpand macroexpand-1 monitor-enter monitor-exit " - \ . "eval find-doc file-seq flush hash load load-file " - \ . "print-doc read read-line scan slurp subs sync test " - \ . "format printf loaded-libs use require load-reader " - \ . "load-string + - * / < <= == >= > dec inc min max neg? " - \ . "pos? quot rem zero? rand rand-int decimal? even? odd? " - \ . "float? integer? number? ratio? rational? " - \ . "bit-and bit-or bit-xor bit-not bit-shift-left " - \ . "bit-shift-right symbol keyword gensym count conj seq " - \ . "first rest ffirst fnext nfirst nnext second every? " - \ . "not-every? some not-any? concat reverse cycle " - \ . "interleave interpose split-at split-with take " - \ . "take-nth take-while drop drop-while repeat replicate " - \ . "iterate range into distinct sort sort-by zipmap " - \ . "line-seq butlast last nth nthnext next " - \ . "repeatedly tree-seq enumeration-seq iterator-seq " - \ . "coll? associative? empty? list? reversible? " - \ . "sequential? sorted? list list* cons peek pop vec " - \ . "vector peek pop rseq subvec array-map hash-map " - \ . "sorted-map sorted-map-by assoc assoc-in dissoc get " - \ . "get-in contains? find select-keys update-in key val " - \ . "keys vals merge merge-with max-key min-key " - \ . "create-struct struct-map struct accessor " - \ . "remove-method meta with-meta in-ns refer create-ns " - \ . "find-ns all-ns remove-ns import ns-name ns-map " - \ . "ns-interns ns-publics ns-imports ns-refers ns-resolve " - \ . "resolve ns-unmap name namespace require use " - \ . "set! find-var var-get var-set ref deref " - \ . "ensure alter ref-set commute agent send send-off " - \ . "agent-errors clear-agent-errors await await-for " - \ . "instance? bean alength aget aset aset-boolean " - \ . "aset-byte aset-char aset-double aset-float " - \ . "aset-int aset-long aset-short make-array " - \ . "to-array to-array-2d into-array int long float " - \ . "double char boolean short byte parse add-classpath " - \ . "cast class get-proxy-class proxy-mappings " - \ . "update-proxy hash-set sorted-set set disj set? " - \ . "aclone add-watch alias alter-var-root " - \ . "ancestors await1 bases bigdec bigint bit-and-not " - \ . "bit-clear bit-flip bit-set bit-test counted?" - \ . "char-escape-string char-name-string class? " - \ . "compare compile construct-proxy delay? " - \ . "derive descendants distinct? double-array " - \ . "doubles drop-last empty float-array floats " - \ . "force gen-class get-validator int-array ints " - \ . "isa? long-array longs make-hierarchy method-sig " - \ . "not-empty ns-aliases ns-unalias num partition " - \ . "parents pmap prefer-method primitives-classnames " - \ . "print-ctor print-dup print-method print-simple " - \ . "print-special-doc proxy-call-with-super " - \ . "proxy-super rationalize read-string remove " - \ . "remove-watch replace resultset-seq rsubseq " - \ . "seque set-validator! shutdown-agents subseq " - \ . "special-form-anchor syntax-symbol-anchor supers " - \ . "unchecked-add unchecked-dec unchecked-divide " - \ . "unchecked-inc unchecked-multiply unchecked-negate " - \ . "unchecked-subtract underive xml-seq trampoline " - \ . "atom compare-and-set! ifn? gen-interface " - \ . "intern init-proxy io! memoize proxy-name swap! " - \ . "release-pending-sends the-ns unquote while " - \ . "unchecked-remainder alter-meta! " - \ . "future-call methods mod pcalls prefers pvalues " - \ . "print-namespace-doc reset! " - \ . "reset-meta! type vary-meta unquote-splicing " - \ . "sequence clojure-version counted? " - \ . "chunk-buffer chunk-append chunk chunk-first " - \ . "chunk-rest chunk-next chunk-cons chunked-seq? " - \ . "deliver future? future-done? future-cancel " - \ . "future-cancelled? get-method promise " - \ . "ref-history-count ref-min-history ref-max-history " - \ . "agent-error assoc! boolean-array booleans bound-fn* " - \ . "bound? byte-array bytes char-array char? chars " - \ . "conj! denominator disj! dissoc! error-handler " - \ . "error-mode extenders extends? find-protocol-impl " - \ . "find-protocol-method flatten frequencies " - \ . "get-thread-bindings group-by hash-combine juxt " - \ . "munge namespace-munge numerator object-array " - \ . "partition-all partition-by persistent! pop! " - \ . "pop-thread-bindings push-thread-bindings rand-nth " - \ . "reductions remove-all-methods restart-agent " - \ . "satisfies? set-error-handler! set-error-mode! " - \ . "short-array shorts shuffle sorted-set-by take-last " - \ . "thread-bound? transient vector-of with-bindings* fnil " - \ . "spit" - \ } - - for category in keys(s:builtins_map) - let words = split(s:builtins_map[category], " ") - let words = map(copy(words), '"clojure.core/" . v:val') + words - let s:builtins_map[category] = words - endfor - - call vimclojure#ColorNamespace(s:builtins_map) -endif - -if g:vimclojure#DynamicHighlighting != 0 && exists("b:vimclojure_namespace") - try - let s:result = vimclojure#ExecuteNailWithInput("DynamicHighlighting", - \ b:vimclojure_namespace) - if s:result.stderr == "" - call vimclojure#ColorNamespace(s:result.value) - unlet s:result - endif - catch /.*/ - " We ignore errors here. If the file is messed up, we at least get - " the basic syntax highlighting. - endtry -endif - -syn cluster clojureAtomCluster contains=clojureError,clojureFunc,clojureMacro,clojureCond,clojureDefine,clojureRepeat,clojureException,clojureConstant,clojureVariable,clojureSpecial,clojureKeyword,clojureString,clojureCharacter,clojureNumber,clojureBoolean,clojureQuote,clojureUnquote,clojureDispatch,clojurePattern -syn cluster clojureTopCluster contains=@clojureAtomCluster,clojureComment,clojureSexp,clojureAnonFn,clojureVector,clojureMap,clojureSet - -syn keyword clojureTodo contained FIXME XXX TODO FIXME: XXX: TODO: -syn match clojureComment contains=clojureTodo ";.*$" - -syn match clojureKeyword "\c:\{1,2}[a-z?!\-_+*./=<>#$][a-z0-9?!\-_+*\./=<>#$]*" - -syn region clojureString start=/L\="/ skip=/\\\\\|\\"/ end=/"/ - -syn match clojureCharacter "\\." -syn match clojureCharacter "\\[0-7]\{3\}" -syn match clojureCharacter "\\u[0-9]\{4\}" -syn match clojureCharacter "\\space" -syn match clojureCharacter "\\tab" -syn match clojureCharacter "\\newline" -syn match clojureCharacter "\\return" -syn match clojureCharacter "\\backspace" -syn match clojureCharacter "\\formfeed" - -let radixChars = "0123456789abcdefghijklmnopqrstuvwxyz" -for radix in range(2, 36) - execute 'syn match clojureNumber "\c\<-\?' . radix . 'r[' - \ . strpart(radixChars, 0, radix) - \ . ']\+\>"' -endfor - -syn match clojureNumber "\<-\=[0-9]\+\(M\|\(\.[0-9]*\)\=\([eE][-+]\=[0-9]\+\)\=\)\=\>" -syn match clojureNumber "\<-\=0x[0-9a-fA-F]\+\>" -syn match clojureNumber "\<-\=[0-9]\+/[0-9]\+\>" - -syn match clojureQuote "\('\|`\)" -syn match clojureUnquote "\(\~@\|\~\)" -syn match clojureDispatch "\(#^\|#'\)" - -syn match clojureAnonArg contained "%\(\d\|&\)\?" -syn match clojureVarArg contained "&" - -if vimclojure#ParenRainbow != 0 - syn region clojureSexpLevel0 matchgroup=clojureParen0 start="(" matchgroup=clojureParen0 end=")" contains=@clojureTopCluster,clojureSexpLevel1 - syn region clojureSexpLevel1 matchgroup=clojureParen1 start="(" matchgroup=clojureParen1 end=")" contained contains=@clojureTopCluster,clojureSexpLevel2 - syn region clojureSexpLevel2 matchgroup=clojureParen2 start="(" matchgroup=clojureParen2 end=")" contained contains=@clojureTopCluster,clojureSexpLevel3 - syn region clojureSexpLevel3 matchgroup=clojureParen3 start="(" matchgroup=clojureParen3 end=")" contained contains=@clojureTopCluster,clojureSexpLevel4 - syn region clojureSexpLevel4 matchgroup=clojureParen4 start="(" matchgroup=clojureParen4 end=")" contained contains=@clojureTopCluster,clojureSexpLevel5 - syn region clojureSexpLevel5 matchgroup=clojureParen5 start="(" matchgroup=clojureParen5 end=")" contained contains=@clojureTopCluster,clojureSexpLevel6 - syn region clojureSexpLevel6 matchgroup=clojureParen6 start="(" matchgroup=clojureParen6 end=")" contained contains=@clojureTopCluster,clojureSexpLevel7 - syn region clojureSexpLevel7 matchgroup=clojureParen7 start="(" matchgroup=clojureParen7 end=")" contained contains=@clojureTopCluster,clojureSexpLevel8 - syn region clojureSexpLevel8 matchgroup=clojureParen8 start="(" matchgroup=clojureParen8 end=")" contained contains=@clojureTopCluster,clojureSexpLevel9 - syn region clojureSexpLevel9 matchgroup=clojureParen9 start="(" matchgroup=clojureParen9 end=")" contained contains=@clojureTopCluster,clojureSexpLevel0 -else - syn region clojureSexp matchgroup=clojureParen0 start="(" matchgroup=clojureParen0 end=")" contains=@clojureTopCluster -endif - -syn region clojureAnonFn matchgroup=clojureParen0 start="#(" matchgroup=clojureParen0 end=")" contains=@clojureTopCluster,clojureAnonArg,clojureSexpLevel0 -syn region clojureVector matchgroup=clojureParen0 start="\[" matchgroup=clojureParen0 end="\]" contains=@clojureTopCluster,clojureVarArg,clojureSexpLevel0 -syn region clojureMap matchgroup=clojureParen0 start="{" matchgroup=clojureParen0 end="}" contains=@clojureTopCluster,clojureSexpLevel0 -syn region clojureSet matchgroup=clojureParen0 start="#{" matchgroup=clojureParen0 end="}" contains=@clojureTopCluster,clojureSexpLevel0 - -syn region clojurePattern start=/L\=\#"/ skip=/\\\\\|\\"/ end=/"/ - -syn region clojureCommentSexp start="(" end=")" transparent contained contains=clojureCommentSexp -syn region clojureComment matchgroup=clojureParen0 start="(comment"rs=s+1 matchgroup=clojureParen0 end=")" contains=clojureCommentSexp -syn region clojureComment start="#!" end="\n" -syn match clojureComment "#_" - -syn sync fromstart - -if version >= 600 - command -nargs=+ HiLink highlight default link -else - command -nargs=+ HiLink highlight link -endif - -HiLink clojureConstant Constant -HiLink clojureBoolean Boolean -HiLink clojureCharacter Character -HiLink clojureKeyword Operator -HiLink clojureNumber Number -HiLink clojureString String -HiLink clojurePattern Constant - -HiLink clojureVariable Identifier -HiLink clojureCond Conditional -HiLink clojureDefine Define -HiLink clojureException Exception -HiLink clojureFunc Function -HiLink clojureMacro Macro -HiLink clojureRepeat Repeat - -HiLink clojureQuote Special -HiLink clojureUnquote Special -HiLink clojureDispatch Special -HiLink clojureAnonArg Special -HiLink clojureVarArg Special -HiLink clojureSpecial Special - -HiLink clojureComment Comment -HiLink clojureTodo Todo - -HiLink clojureError Error - -HiLink clojureParen0 Delimiter - -if vimclojure#ParenRainbow != 0 - if &background == "dark" - highlight default clojureParen1 ctermfg=yellow guifg=orange1 - highlight default clojureParen2 ctermfg=green guifg=yellow1 - highlight default clojureParen3 ctermfg=cyan guifg=greenyellow - highlight default clojureParen4 ctermfg=magenta guifg=green1 - highlight default clojureParen5 ctermfg=red guifg=springgreen1 - highlight default clojureParen6 ctermfg=yellow guifg=cyan1 - highlight default clojureParen7 ctermfg=green guifg=slateblue1 - highlight default clojureParen8 ctermfg=cyan guifg=magenta1 - highlight default clojureParen9 ctermfg=magenta guifg=purple1 - else - highlight default clojureParen1 ctermfg=darkyellow guifg=orangered3 - highlight default clojureParen2 ctermfg=darkgreen guifg=orange2 - highlight default clojureParen3 ctermfg=blue guifg=yellow3 - highlight default clojureParen4 ctermfg=darkmagenta guifg=olivedrab4 - highlight default clojureParen5 ctermfg=red guifg=green4 - highlight default clojureParen6 ctermfg=darkyellow guifg=paleturquoise3 - highlight default clojureParen7 ctermfg=darkgreen guifg=deepskyblue4 - highlight default clojureParen8 ctermfg=blue guifg=darkslateblue - highlight default clojureParen9 ctermfg=darkmagenta guifg=darkviolet - endif -endif - -delcommand HiLink - -let b:current_syntax = "clojure"