--- a/.offlineimaprc Mon Nov 01 08:37:48 2010 -0400
+++ b/.offlineimaprc Mon Nov 01 08:38:45 2010 -0400
@@ -1,8 +1,23 @@
[general]
ui = TTY.TTYUI
-accounts = SteveLosh
+accounts = SteveLosh, Dumbwaiter
pythonfile=~/.mutt/offlineimap.py
+[Account Dumbwaiter]
+localrepository = Dumbwaiter-Local
+remoterepository = Dumbwaiter-Remote
+
+[Repository Dumbwaiter-Local]
+type = Maildir
+localfolders = ~/.mail/steve-dumbwaiterdesign.com
+
+[Repository Dumbwaiter-Remote]
+type = Gmail
+remoteuser = steve@dumbwaiterdesign.com
+remotepasseval = get_keychain_pass(account="steve@dumbwaiterdesign.com", server="imap.gmail.com")
+realdelete = no
+nametrans = lambda folder: re.sub('.*Spam$', 'spam', re.sub('.*Drafts$', 'drafts', re.sub('.*Sent Mail$', 'sent', re.sub('.*Starred$', 'flagged', re.sub('.*Trash$', 'trash', re.sub('.*All Mail$', 'archive', folder))))))
+
[Account SteveLosh]
localrepository = SteveLosh-Local
remoterepository = SteveLosh-Remote
--- a/mutt/colors.muttrc Mon Nov 01 08:37:48 2010 -0400
+++ b/mutt/colors.muttrc Mon Nov 01 08:38:45 2010 -0400
@@ -26,14 +26,14 @@
color signature color244 color233
# quote levels
-color quoted color34 default
-color quoted1 color142 default
-color quoted2 color34 default
-color quoted3 color142 default
-color quoted4 color34 default
-color quoted5 color142 default
-color quoted6 color34 default
-color quoted7 color142 default
-color quoted8 color34 default
-color quoted9 color142 default
+color quoted color34 color233
+color quoted1 color142 color233
+color quoted2 color34 color233
+color quoted3 color142 color233
+color quoted4 color34 color233
+color quoted5 color142 color233
+color quoted6 color34 color233
+color quoted7 color142 color233
+color quoted8 color34 color233
+color quoted9 color142 color233
--- a/mutt/muttrc Mon Nov 01 08:37:48 2010 -0400
+++ b/mutt/muttrc Mon Nov 01 08:38:45 2010 -0400
@@ -75,16 +75,17 @@
hdr_order from: to: cc: date: subject: # and in this order
# boxes
-mailboxes +steve-stevelosh.com/INBOX +steve-stevelosh.com/archive +steve-stevelosh.com/sent +steve-stevelosh.com/drafts +steve-stevelosh.com/spam +steve-stevelosh.com/trash
+mailboxes +steve-stevelosh.com/INBOX +steve-stevelosh.com/archive +steve-stevelosh.com/sent +steve-stevelosh.com/drafts +steve-stevelosh.com/spam +steve-stevelosh.com/trash +steve-dumbwaiterdesign.com/INBOX +steve-dumbwaiterdesign.com/archive +steve-dumbwaiterdesign.com/sent +steve-dumbwaiterdesign.com/drafts +steve-dumbwaiterdesign.com/spam +steve-dumbwaiterdesign.com/trash
# always sourced
-#source $alias_file # required for functionality
+#source $alias_file # required for functionality
source ~/.mutt/colors.muttrc # source colors file
-source ~/.mutt/steve-stevelosh.com.muttrc # source gmail as default
+source ~/.mutt/steve-stevelosh.com.muttrc # source gmail as default
source ~/.mutt/sidebar.muttrc # any muttng options are here
# account specific sources
folder-hook steve-stevelosh.com/* source ~/.mutt/steve-stevelosh.com.muttrc
+folder-hook steve-dumbwaiterdesign.com/* source ~/.mutt/steve-dumbwaiterdesign.com.muttrc
# these just give me headaches
bind index,pager \# noop
@@ -93,8 +94,6 @@
# bindings
bind pager i exit
bind pager / search
-bind pager <up> previous-line
-bind pager <down> next-line
bind pager k previous-line
bind pager j next-line
bind pager gg top
@@ -108,9 +107,10 @@
bind index,pager R group-reply
# macros
-macro index \Cr "<tag-prefix><clear-flag>N" "mark tagged messages as read"
-macro index B "<limit>~b " "search message bodies"
-macro index I "<change-folder>!<enter>" "go to Inbox"
+macro index \Cr "<tag-prefix><clear-flag>N" "mark tagged messages as read"
+macro index \CR "T.<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "mark all messages as read"
+macro index B "<limit>~b " "search message bodies"
+macro index I "<change-folder>!<enter>" "go to Inbox"
# save a decoded copy in ~
macro index P "<pipe-message>cat > ~/Desktop/" "save message as"
--- a/mutt/sidebar.muttrc Mon Nov 01 08:37:48 2010 -0400
+++ b/mutt/sidebar.muttrc Mon Nov 01 08:38:45 2010 -0400
@@ -11,7 +11,7 @@
color sidebar_new color117 color233
# bindings
-bind index,pager \CN sidebar-next
-bind index,pager \CP sidebar-prev
-bind index,pager \CO sidebar-open
+bind index,pager <down> sidebar-next
+bind index,pager <up> sidebar-prev
+bind index,pager <right> sidebar-open
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mutt/steve-dumbwaiterdesign.com.muttrc Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,11 @@
+set from = "steve@dumbwaiterdesign.com"
+set sendmail = "/usr/local/bin/msmtp -a dwaiter"
+set mbox = "+steve-dumbwaiterdesign.com/archive"
+unset record
+set postponed = "+steve-dumbwaiterdesign.com/drafts"
+
+macro index E "<change-folder>+steve-dumbwaiterdesign.com/archive<enter><limit>~B " "search everything"
+macro index A "<save-message>+steve-dumbwaiterdesign.com/archive<enter>" "move message to the archive"
+macro index D "<save-message>+steve-dumbwaiterdesign.com/trash<enter>" "move message to the trash"
+macro index S "<save-message>+steve-dumbwaiterdesign.com/spam<enter>" "mark message as spam"
+
--- a/vim/.vimrc Mon Nov 01 08:37:48 2010 -0400
+++ b/vim/.vimrc Mon Nov 01 08:38:45 2010 -0400
@@ -40,6 +40,9 @@
" Leader
let mapleader = ","
+" Make Y not dumb
+nnoremap Y y$
+
" Searching
nnoremap / /\v
vnoremap / /\v
@@ -427,6 +430,10 @@
nnoremap yiN" F"yi"
nnoremap yaN" F"ya"
+" VimClojure
+let vimclojure#HighlightBuiltins=1
+let vimclojure#ParenRainbow=1
+
if has('gui_running')
set guifont=Menlo:h12
colorscheme molokai
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/.hgignore Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,6 @@
+syntax: glob
+.DS_Store
+*-keys.txt
+build
+ng
+.gradle
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/.hgtags Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,12 @@
+e8d8859038f059eaa428bc062ba40572baf95959 v1.0.0
+2d2fd57659f1863b71a1da3867df7f4af9645b12 v1.0.2
+44f0257f69bfb51cd400e7e1fceb64daecf61eaa v1.1.0
+192e23be12b48b0d3b07b5167f767ec959ee780f v1.1.1
+d1bf8ed221afbf976617909a0ad31495f7146d36 v1.2.0
+71e475ca98d45ae5e29fae03961e5236c626aeab v1.2.1
+e0f82e2807b10dd718a6e20726154d16312fb64b v1.3.0
+bab4b136685bd12809ec7d755b3bf080cf24cd26 v2.0.0
+1a8128b68aab1d6e4c6b960b61b6684ac7e63b06 v2.1.0
+ebc7d51caa8f7aafdc916c4f681112f9be24444b v2.1.1
+3c4c4bc70e35280175aa9b60a2b438572619a692 v2.1.2
+d86f147b463088792300dc25a812a4ff43e604d6 v2.2.0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/autoload/vimclojure.vim Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,1004 @@
+" Part of Vim filetype plugin for Clojure
+" Language: Clojure
+" Maintainer: Meikel Brandmeyer <mb@kotka.de>
+
+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 . " = <desired value here>"
+ 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#GetExceptionFoldLevel(lnum)
+ if a:lnum == 1
+ return 0
+ endif
+
+ let pline = getline(a:lnum - 1)
+ let line = getline(a:lnum)
+
+ if line[0] == '+' && pline[0] == '!'
+ return ">1"
+ endif
+
+ if line[0] != '+' && line[0] != '|'
+ return 0
+ endif
+
+ return "="
+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 <Plug>Clojure" . a:plug
+ \ . " :call " . a:f . "(" . a:args . ")<CR>"
+endfunction
+
+function! vimclojure#MakeProtectedPlug(mode, plug, f, args)
+ execute a:mode . "noremap <Plug>Clojure" . a:plug
+ \ . " :call vimclojure#ProtectedPlug(function(\""
+ \ . a:f . "\"), [ " . a:args . " ])<CR>"
+endfunction
+
+function! vimclojure#MapPlug(mode, keys, plug)
+ if !hasmapto("<Plug>Clojure" . a:plug)
+ execute a:mode . "map <buffer> <unique> <silent> <LocalLeader>" . a:keys
+ \ . " <Plug>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 <buffer> <silent> <LocalLeader>" . a:keys
+ \ . " " . msg . "<CR>"
+ 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("<abuf>"))
+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)
+ let b:vimclojure_clojure_result_buffer = 1
+
+ set filetype=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("<Plug>ClojureReplEnterHook")
+ imap <buffer> <silent> <CR> <Plug>ClojureReplEnterHook
+ endif
+ if !hasmapto("<Plug>ClojureReplUpHistory")
+ imap <buffer> <silent> <C-Up> <Plug>ClojureReplUpHistory
+ endif
+ if !hasmapto("<Plug>ClojureReplDownHistory")
+ imap <buffer> <silent> <C-Down> <Plug>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\<CR>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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/doc/clojure.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,343 @@
+*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 <LocalLeader>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: <LocalLeader> 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 <Plug>Clojure to the given
+Plug name and your setting will override the default mapping.
+>
+ aucmd BufRead,BufNewFile *.clj nmap xyz <Plug>ClojureEvalToplevel
+<
+
+<LocalLeader>et *et* *EvalToplevel*
+ Send off the toplevel sexpression currently
+ containing the cursor to the Clojure server.
+
+<LocalLeader>ef *ef* *EvalFile*
+ Send off the current file to the Clojure Server.
+
+<LocalLeader>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.
+
+<LocalLeader>el *el* *EvalLine*
+ Send off the current line to the Clojure Server.
+ Note: This does not check for structure.
+
+<LocalLeader>ep *ep* *EvalParagraph*
+ Send off the current paragraph to the Clojure Server.
+ Note: This does not check for structure.
+
+<LocalLeader>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.
+
+<LocalLeader>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.
+
+<LocalLeader>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.
+
+<LocalLeader>me *me* *MacroExpand*
+ Expand the innermost sexpression currently
+ containing the cursor using macroexpand.
+
+<LocalLeader>m1 *m1* *MacroExpand1*
+ Same as MacroExpand, but use macroexpand-1.
+
+
+<LocalLeader>lw *lw* *DocLookupWord*
+ Lookup up the word under the cursor and print
+ the documentation for it via (doc).
+
+<LocalLeader>li *li* *DocLookupInteractive*
+ Lookup the documentation of an arbitrary word.
+ The user is prompted for input.
+
+<LocalLeader>fd *fd* *FindDoc*
+ Find a the documentation for a given pattern
+ with (find-doc). The user is prompted for input.
+
+<LocalLeader>jw *jw* *JavadocLookupWord*
+ Open the javadoc for the word under the cursor
+ in an external browser.
+
+<LocalLeader>ji *ji* *JavadocLookupInteractive*
+ Open the javadoc for an arbitrary word in an
+ external browser. The user is prompted for input.
+
+<LocalLeader>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).
+
+<LocalLeader>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).
+
+<LocalLeader>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.
+
+<LocalLeader>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.
+
+<LocalLeader>mw *mw* *MetaLookupWord*
+ Lookup the meta data of the word under the cursor.
+
+<LocalLeader>mi *mi* *MetaLookupInteractive*
+ Lookup the meta data of an arbitrary word. The
+ user is prompted for input.
+
+<LocalLeader>sr *sr* *StartRepl*
+ Start a new Vim Repl in a fresh buffer. There
+ might be multiple Repls at the same time.
+
+<LocalLeader>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.
+
+<LocalLeader>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 <C-Up> and <C-Down>.
+Note: sending multiple expressions will save them in the same history
+entry. So playing back with <C-Up> will again send all of the contained
+expressions.
+
+The Plugs are:
+ - <Plug>ClojureReplEnterHook for the enter key
+ - <Plug>ClojureReplUpHistory for going backwards in history (<C-Up>)
+ - <Plug>ClojureReplDownHistory for going forwards in history (<C-Down>)
+
+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 <C-X><C-O> 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<C-x><C-o> => String, StringBuilder, ...
+
+ - a word containing dots will be completed to a namespace.
+ c.c<C-x><C-o> => 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<C-x><C-o> => String/valueOf
+
+ - otherwise it is treated as a namespace or alias
+ clojure.core/re<C-x><C-o> => clojure.core/read, ...
+
+The completion uses certain characters to split the matching. This are
+hyphens and (for namespaces) dots. So r-s<C-x><C-o> matches read-string.
+
+Note: Completion of symbols and keywords is also provided via the <C-N>
+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 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftdetect/clojure.vim Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,1 @@
+au BufNewFile,BufRead *.clj set filetype=clojure
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure.vim Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,148 @@
+" Vim filetype plugin file
+" Language: Clojure
+" Maintainer: Meikel Brandmeyer <mb@kotka.de>
+
+" 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 <CR> 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 <buffer> if pumvisible() == 0 | pclose | endif
+ augroup END
+endif
+
+call vimclojure#MapPlug("n", "p", "CloseResultBuffer")
+
+if exists("b:vimclojure_repl") || exists("b:vimclojure_clojure_result_buffer")
+ setlocal foldexpr=vimclojure#GetExceptionFoldLevel(v:lnum)
+ setlocal foldmethod=expr
+ setlocal foldenable
+endif
+
+let &cpo = s:cpo_save
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.core.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,526 @@
+*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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.inspector.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,13 @@
+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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.browse.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,2 @@
+*open-url-script*
+browse-url
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.io.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,19 @@
+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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.javadoc.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,8 @@
+*core-java-api*
+*feeling-lucky*
+*feeling-lucky-url*
+*local-javadocs*
+*remote-javadocs*
+add-local-javadoc
+add-remote-javadoc
+javadoc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.java.shell.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,4 @@
+*sh-dir*
+*sh-env*
+with-sh-dir
+with-sh-env
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.main.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,10 @@
+load-script
+main
+repl
+repl-caught
+repl-exception
+repl-prompt
+repl-read
+skip-if-eol
+skip-whitespace
+with-bindings
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.pprint.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,23 @@
+*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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.repl.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,5 @@
+apropos
+dir
+dir-fn
+source
+source-fn
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.set.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,12 @@
+difference
+index
+intersection
+join
+map-invert
+project
+rename
+rename-keys
+select
+subset?
+superset?
+union
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.stacktrace.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,5 @@
+print-cause-trace
+print-stack-trace
+print-throwable
+print-trace-element
+root-cause
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.string.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,15 @@
+blank?
+capitalize
+escape
+join
+lower-case
+replace
+replace-first
+reverse
+split
+split-lines
+trim
+trim-newline
+triml
+trimr
+upper-case
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.template.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,2 @@
+apply-template
+do-template
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.test.junit.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,18 @@
+*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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.test.tap.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,6 @@
+print-tap-diagnostic
+print-tap-fail
+print-tap-pass
+print-tap-plan
+tap-report
+with-tap-output
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.test.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,34 @@
+*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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.walk.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,10 @@
+keywordize-keys
+macroexpand-all
+postwalk
+postwalk-demo
+postwalk-replace
+prewalk
+prewalk-demo
+prewalk-replace
+stringify-keys
+walk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.xml.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,13 @@
+*current*
+*sb*
+*stack*
+*state*
+attrs
+content
+content-handler
+element
+emit
+emit-element
+parse
+startparse-sax
+tag
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/ftplugin/clojure/completions-clojure.zip.txt Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,27 @@
+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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/indent/clojure.vim Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,208 @@
+" Vim indent file
+" Language: Clojure
+" Maintainer: Meikel Brandmeyer <mb@kotka.de>
+" 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/plugin/clojure.vim Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,57 @@
+" Vim filetype plugin file
+" Language: Clojure
+" Maintainer: Meikel Brandmeyer <mb@kotka.de>
+
+" 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(\"<cword>\")")
+
+call vimclojure#MakeProtectedPlug("n", "DocLookupWord", "vimclojure#DocLookup", "expand(\"<cword>\")")
+call vimclojure#MakeProtectedPlug("n", "DocLookupInteractive", "vimclojure#DocLookup", "input(\"Symbol to look up: \")")
+call vimclojure#MakeProtectedPlug("n", "JavadocLookupWord", "vimclojure#JavadocLookup", "expand(\"<cword>\")")
+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(\"<cword>\")")
+call vimclojure#MakeProtectedPlug("n", "MetaLookupInteractive", "vimclojure#MetaLookup", "input(\"Symbol to look up: \")")
+
+call vimclojure#MakeProtectedPlug("n", "SourceLookupWord", "vimclojure#SourceLookup", "expand(\"<cword>\")")
+call vimclojure#MakeProtectedPlug("n", "SourceLookupInteractive", "vimclojure#SourceLookup", "input(\"Symbol to look up: \")")
+
+call vimclojure#MakeProtectedPlug("n", "GotoSourceWord", "vimclojure#GotoSource", "expand(\"<cword>\")")
+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 <Plug>ClojureReplEnterHook <Esc>:call b:vimclojure_repl.enterHook()<CR>
+inoremap <Plug>ClojureReplUpHistory <C-O>:call b:vimclojure_repl.upHistory()<CR>
+inoremap <Plug>ClojureReplDownHistory <C-O>:call b:vimclojure_repl.downHistory()<CR>
+
+nnoremap <Plug>ClojureCloseResultBuffer :call vimclojure#ResultBuffer.CloseBuffer()<CR>
+
+let &cpo = s:cpo_save
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vim/bundle/vimclojure/syntax/clojure.vim Mon Nov 01 08:38:45 2010 -0400
@@ -0,0 +1,304 @@
+" Vim syntax file
+" Language: Clojure
+" Maintainer: Toralf Wittner <toralf.wittner@gmail.com>
+" modified by Meikel Brandmeyer <mb@kotka.de>
+" 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,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 "#_"
+
+if exists("b:vimclojure_repl") || exists("b:vimclojure_clojure_result_buffer")
+ syn region clojureException start=/^!!/ end=/\n/
+endif
+
+syn sync fromstart
+
+if version >= 600
+ command -nargs=+ HiLink highlight default link <args>
+else
+ command -nargs=+ HiLink highlight link <args>
+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 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 clojureException 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"