Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add vim configuration

  • Loading branch information...
commit bc2bddff9c5cc906af62eb3776149f5d067dca60 1 parent c116253
@invalid-email-address invalid-email-address authored
Showing with 3,596 additions and 269 deletions.
  1. +1 −0  aliases
  2. +3 −0  vim/.netrwhist
  3. +250 −0 vim/autoload/pathogen.vim
  4. +1,095 −0 vim/autoload/vimclojure.vim
  5. +108 −0 vim/autoload/vimclojure/util.vim
  6. +1 −0  vim/bundle/nerdtree
  7. +20 −0 vim/doc/LICENSE.txt
  8. +433 −0 vim/doc/clojure.txt
  9. +56 −269 vim/doc/tags
  10. +1 −0  vim/ftdetect/clojure.vim
  11. +147 −0 vim/ftplugin/clojure.vim
  12. +544 −0 vim/ftplugin/clojure/completions-clojure.core.txt
  13. +1 −0  vim/ftplugin/clojure/completions-clojure.data.txt
  14. +13 −0 vim/ftplugin/clojure/completions-clojure.inspector.txt
  15. +2 −0  vim/ftplugin/clojure/completions-clojure.java.browse.txt
  16. +19 −0 vim/ftplugin/clojure/completions-clojure.java.io.txt
  17. +8 −0 vim/ftplugin/clojure/completions-clojure.java.javadoc.txt
  18. +4 −0 vim/ftplugin/clojure/completions-clojure.java.shell.txt
  19. +13 −0 vim/ftplugin/clojure/completions-clojure.main.txt
  20. +25 −0 vim/ftplugin/clojure/completions-clojure.pprint.txt
  21. +13 −0 vim/ftplugin/clojure/completions-clojure.repl.txt
  22. +12 −0 vim/ftplugin/clojure/completions-clojure.set.txt
  23. +5 −0 vim/ftplugin/clojure/completions-clojure.stacktrace.txt
  24. +15 −0 vim/ftplugin/clojure/completions-clojure.string.txt
  25. +2 −0  vim/ftplugin/clojure/completions-clojure.template.txt
  26. +18 −0 vim/ftplugin/clojure/completions-clojure.test.junit.txt
  27. +6 −0 vim/ftplugin/clojure/completions-clojure.test.tap.txt
  28. +35 −0 vim/ftplugin/clojure/completions-clojure.test.txt
  29. +10 −0 vim/ftplugin/clojure/completions-clojure.walk.txt
  30. +13 −0 vim/ftplugin/clojure/completions-clojure.xml.txt
  31. +27 −0 vim/ftplugin/clojure/completions-clojure.zip.txt
  32. +268 −0 vim/indent/clojure.vim
  33. +60 −0 vim/plugin/clojure.vim
  34. +357 −0 vim/syntax/clojure.vim
  35. +8 −0 vimrc
  36. +2 −0  zlogin
  37. +1 −0  zshrc
View
1  aliases
@@ -70,3 +70,4 @@ token=`mongo --quiet sli --eval 'db.userSession.find({"body.principal.externalId
response=`curl -s -H "Content-type: application/json" -H "accept: application/${format}" -H "Authorization: bearer $token" $url`
echo $response | python -mjson.tool
}
+
View
3  vim/.netrwhist
@@ -0,0 +1,3 @@
+let g:netrw_dirhistmax =10
+let g:netrw_dirhist_cnt =1
+let g:netrw_dirhist_1='/Users/pghosh/.zsh'
View
250 vim/autoload/pathogen.vim
@@ -0,0 +1,250 @@
+" pathogen.vim - path option manipulation
+" Maintainer: Tim Pope <http://tpo.pe/>
+" Version: 2.0
+
+" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
+"
+" For management of individually installed plugins in ~/.vim/bundle (or
+" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc
+" prior to `filetype plugin indent on` is the only other setup necessary.
+"
+" The API is documented inline below. For maximum ease of reading,
+" :set foldmethod=marker
+
+if exists("g:loaded_pathogen") || &cp
+ finish
+endif
+let g:loaded_pathogen = 1
+
+" Point of entry for basic default usage. Give a directory name to invoke
+" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path
+" to invoke pathogen#runtime_prepend_subdirectories(). Afterwards,
+" pathogen#cycle_filetype() is invoked.
+function! pathogen#infect(...) abort " {{{1
+ let source_path = a:0 ? a:1 : 'bundle'
+ if source_path =~# '[\\/]'
+ call pathogen#runtime_prepend_subdirectories(source_path)
+ else
+ call pathogen#runtime_append_all_bundles(source_path)
+ endif
+ call pathogen#cycle_filetype()
+endfunction " }}}1
+
+" Split a path into a list.
+function! pathogen#split(path) abort " {{{1
+ if type(a:path) == type([]) | return a:path | endif
+ let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
+ return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
+endfunction " }}}1
+
+" Convert a list to a path.
+function! pathogen#join(...) abort " {{{1
+ if type(a:1) == type(1) && a:1
+ let i = 1
+ let space = ' '
+ else
+ let i = 0
+ let space = ''
+ endif
+ let path = ""
+ while i < a:0
+ if type(a:000[i]) == type([])
+ let list = a:000[i]
+ let j = 0
+ while j < len(list)
+ let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
+ let path .= ',' . escaped
+ let j += 1
+ endwhile
+ else
+ let path .= "," . a:000[i]
+ endif
+ let i += 1
+ endwhile
+ return substitute(path,'^,','','')
+endfunction " }}}1
+
+" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
+function! pathogen#legacyjoin(...) abort " {{{1
+ return call('pathogen#join',[1] + a:000)
+endfunction " }}}1
+
+" Remove duplicates from a list.
+function! pathogen#uniq(list) abort " {{{1
+ let i = 0
+ let seen = {}
+ while i < len(a:list)
+ if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
+ call remove(a:list,i)
+ elseif a:list[i] ==# ''
+ let i += 1
+ let empty = 1
+ else
+ let seen[a:list[i]] = 1
+ let i += 1
+ endif
+ endwhile
+ return a:list
+endfunction " }}}1
+
+" \ on Windows unless shellslash is set, / everywhere else.
+function! pathogen#separator() abort " {{{1
+ return !exists("+shellslash") || &shellslash ? '/' : '\'
+endfunction " }}}1
+
+" Convenience wrapper around glob() which returns a list.
+function! pathogen#glob(pattern) abort " {{{1
+ let files = split(glob(a:pattern),"\n")
+ return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
+endfunction "}}}1
+
+" Like pathogen#glob(), only limit the results to directories.
+function! pathogen#glob_directories(pattern) abort " {{{1
+ return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
+endfunction "}}}1
+
+" Turn filetype detection off and back on again if it was already enabled.
+function! pathogen#cycle_filetype() " {{{1
+ if exists('g:did_load_filetypes')
+ filetype off
+ filetype on
+ endif
+endfunction " }}}1
+
+" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if
+" its 'basename()' is included in g:pathogen_disabled[]' or ends in a tilde.
+function! pathogen#is_disabled(path) " {{{1
+ if a:path =~# '\~$'
+ return 1
+ elseif !exists("g:pathogen_disabled")
+ return 0
+ endif
+ let sep = pathogen#separator()
+ return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1
+endfunction "}}}1
+
+" Prepend all subdirectories of path to the rtp, and append all 'after'
+" directories in those subdirectories.
+function! pathogen#runtime_prepend_subdirectories(path) " {{{1
+ let sep = pathogen#separator()
+ let before = filter(pathogen#glob_directories(a:path.sep."*"), '!pathogen#is_disabled(v:val)')
+ let after = filter(pathogen#glob_directories(a:path.sep."*".sep."after"), '!pathogen#is_disabled(v:val[0:-7])')
+ let rtp = pathogen#split(&rtp)
+ let path = expand(a:path)
+ call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
+ let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
+ return &rtp
+endfunction " }}}1
+
+" For each directory in rtp, check for a subdirectory named dir. If it
+" exists, add all subdirectories of that subdirectory to the rtp, immediately
+" after the original directory. If no argument is given, 'bundle' is used.
+" Repeated calls with the same arguments are ignored.
+function! pathogen#runtime_append_all_bundles(...) " {{{1
+ let sep = pathogen#separator()
+ let name = a:0 ? a:1 : 'bundle'
+ if "\n".s:done_bundles =~# "\\M\n".name."\n"
+ return ""
+ endif
+ let s:done_bundles .= name . "\n"
+ let list = []
+ for dir in pathogen#split(&rtp)
+ if dir =~# '\<after$'
+ let list += filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
+ else
+ let list += [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)')
+ endif
+ endfor
+ let &rtp = pathogen#join(pathogen#uniq(list))
+ return 1
+endfunction
+
+let s:done_bundles = ''
+" }}}1
+
+" Invoke :helptags on all non-$VIM doc directories in runtimepath.
+function! pathogen#helptags() " {{{1
+ let sep = pathogen#separator()
+ for dir in pathogen#split(&rtp)
+ if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
+ helptags `=dir.'/doc'`
+ endif
+ endfor
+endfunction " }}}1
+
+command! -bar Helptags :call pathogen#helptags()
+
+" Like findfile(), but hardcoded to use the runtimepath.
+function! pathogen#runtime_findfile(file,count) "{{{1
+ let rtp = pathogen#join(1,pathogen#split(&rtp))
+ let file = findfile(a:file,rtp,a:count)
+ if file ==# ''
+ return ''
+ else
+ return fnamemodify(file,':p')
+ endif
+endfunction " }}}1
+
+" Backport of fnameescape().
+function! pathogen#fnameescape(string) " {{{1
+ if exists('*fnameescape')
+ return fnameescape(a:string)
+ elseif a:string ==# '-'
+ return '\-'
+ else
+ return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
+ endif
+endfunction " }}}1
+
+function! s:find(count,cmd,file,lcd) " {{{1
+ let rtp = pathogen#join(1,pathogen#split(&runtimepath))
+ let file = pathogen#runtime_findfile(a:file,a:count)
+ if file ==# ''
+ return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
+ elseif a:lcd
+ let path = file[0:-strlen(a:file)-2]
+ execute 'lcd `=path`'
+ return a:cmd.' '.pathogen#fnameescape(a:file)
+ else
+ return a:cmd.' '.pathogen#fnameescape(file)
+ endif
+endfunction " }}}1
+
+function! s:Findcomplete(A,L,P) " {{{1
+ let sep = pathogen#separator()
+ let cheats = {
+ \'a': 'autoload',
+ \'d': 'doc',
+ \'f': 'ftplugin',
+ \'i': 'indent',
+ \'p': 'plugin',
+ \'s': 'syntax'}
+ if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
+ let request = cheats[a:A[0]].a:A[1:-1]
+ else
+ let request = a:A
+ endif
+ let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
+ let found = {}
+ for path in pathogen#split(&runtimepath)
+ let path = expand(path, ':p')
+ let matches = split(glob(path.sep.pattern),"\n")
+ call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
+ call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
+ for match in matches
+ let found[match] = 1
+ endfor
+ endfor
+ return sort(keys(found))
+endfunction " }}}1
+
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
+
+" vim:set ft=vim ts=8 sw=2 sts=2:
View
1,095 vim/autoload/vimclojure.vim
@@ -0,0 +1,1095 @@
+" 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#FuzzyIndent")
+ let vimclojure#FuzzyIndent = 0
+endif
+
+if !exists("g:vimclojure#FuzzyIndentPatterns")
+ let vimclojure#FuzzyIndentPatterns = "with.*,def.*,let.*"
+endif
+
+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#NailgunServer")
+ let vimclojure#NailgunServer = "127.0.0.1"
+endif
+
+if !exists("g:vimclojure#NailgunPort")
+ let vimclojure#NailgunPort = "2113"
+endif
+
+if !exists("g:vimclojure#UseErrorBuffer")
+ let vimclojure#UseErrorBuffer = 1
+endif
+
+if !exists("g:vimclojure#SetupKeyMap")
+ let vimclojure#SetupKeyMap = 1
+endif
+
+if !exists("g:vimclojure#SearchThreshold")
+ let vimclojure#SearchThreshold = 100
+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#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
+
+function! ClojureExtractSexprWorker() dict
+ let pos = [0, 0]
+ let start = getpos(".")
+
+ if getline(start[1])[start[2] - 1] == "("
+ \ && vimclojure#util#SynIdName() =~ 'clojureParen' . self.level
+ let pos = [start[1], start[2]]
+ endif
+
+ if pos == [0, 0]
+ let pos = searchpairpos('(', '', ')', 'bW' . self.flag,
+ \ 'vimclojure#util#SynIdName() !~ "clojureParen\\d"')
+ endif
+
+ if pos == [0, 0]
+ throw "Error: Not in a s-expression!"
+ endif
+
+ return [pos, vimclojure#util#Yank('l', 'normal! "ly%')]
+endfunction
+
+" Nailgun part:
+function! vimclojure#ExtractSexpr(toplevel)
+ let closure = {
+ \ "flag" : (a:toplevel ? "r" : ""),
+ \ "level" : (a:toplevel ? "0" : '\d'),
+ \ "f" : function("ClojureExtractSexprWorker")
+ \ }
+
+ return vimclojure#util#WithSavedPosition(closure)
+endfunction
+
+function! vimclojure#BufferName()
+ let file = expand("%")
+ if file == ""
+ let file = "UNNAMED"
+ endif
+ return file
+endfunction
+
+" Key mappings and Plugs
+function! vimclojure#MakeProtectedPlug(mode, plug, f, args)
+ execute a:mode . "noremap <Plug>Clojure" . a:plug . "."
+ \ . " :<C-U>call vimclojure#ProtectedPlug(function(\""
+ \ . a:f . "\"), [ " . a:args . " ])<CR>"
+endfunction
+
+function! vimclojure#MakeCommandPlug(mode, plug, f, args)
+ execute a:mode . "noremap <Plug>Clojure" . a:plug . "."
+ \ . " :<C-U>call vimclojure#ProtectedPlug("
+ \ . " function(\"vimclojure#CommandPlug\"),"
+ \ . " [ function(\"" . a:f . "\"), [ " . a:args . " ]])<CR>"
+endfunction
+
+function! vimclojure#MapPlug(mode, keys, plug)
+ if exists("g:vimclojure#SetupKeyMap" . a:plug)
+ execute "let doSetup = g:vimclojure#SetupKeyMap" . a:plug
+ else
+ let doSetup = g:vimclojure#SetupKeyMap
+ endif
+
+ if doSetup && !hasmapto("<Plug>Clojure" . a:plug . ".", a:mode)
+ execute a:mode . "map <buffer> <unique> <silent> <LocalLeader>" . a:keys
+ \ . " <Plug>Clojure" . a:plug . "."
+ endif
+endfunction
+
+if !exists("*vimclojure#CommandPlug")
+ function vimclojure#CommandPlug(f, args)
+ if exists("b:vimclojure_loaded")
+ \ && !exists("b:vimclojure_namespace")
+ \ && g:vimclojure#WantNailgun == 1
+ unlet b:vimclojure_loaded
+ call vimclojure#InitBuffer("silent")
+ endif
+
+ if exists("b:vimclojure_namespace")
+ call call(a:f, a:args)
+ elseif g:vimclojure#WantNailgun == 1
+ let msg = "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."
+ throw msg
+ endif
+ endfunction
+endif
+
+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#Object = {}
+
+function! vimclojure#Object.New(...) dict
+ let instance = copy(self)
+ let instance.prototype = self
+
+ call call(instance.Init, a:000, instance)
+
+ return instance
+endfunction
+
+function! vimclojure#Object.Init() dict
+endfunction
+
+let vimclojure#Buffer = copy(vimclojure#Object)
+let vimclojure#Buffer["__superObjectNew"] = vimclojure#Buffer["New"]
+
+function! vimclojure#Buffer.New(...) dict
+ 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
+
+ return call(self.__superObjectNew, a:000, self)
+endfunction
+
+function! vimclojure#Buffer.Init() dict
+ let self._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("")
+ " XXX: Opening the box of the pandora.
+ " 2012-01-09: Adding Carriage Returns here.
+ let text = split(a:text, '\r\?\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["__superBufferNew"] = vimclojure#ResultBuffer["New"]
+let vimclojure#ResultBuffer["__superBufferInit"] = vimclojure#ResultBuffer["Init"]
+let vimclojure#ResultBuffer.__instance = []
+
+function! ClojureResultBufferNewWorker() dict
+ set switchbuf=useopen
+ call self.instance.goHereWindow()
+ call call(self.instance.Init, self.args, self.instance)
+
+ return self.instance
+endfunction
+
+function! vimclojure#ResultBuffer.New(...) dict
+ if g:vimclojure#ResultBuffer.__instance != []
+ let oldInstance = g:vimclojure#ResultBuffer.__instance[0]
+
+ if oldInstance.prototype is self
+ let closure = {
+ \ 'instance' : oldInstance,
+ \ 'args' : a:000,
+ \ 'f' : function("ClojureResultBufferNewWorker")
+ \ }
+
+ return vimclojure#util#WithSavedOption('switchbuf', closure)
+ else
+ call oldInstance.close()
+ endif
+ endif
+
+ let b:vimclojure_result_buffer = 1
+ let instance = call(self.__superBufferNew, a:000, self)
+ let g:vimclojure#ResultBuffer.__instance = [ instance ]
+
+ return instance
+endfunction
+
+function! vimclojure#ResultBuffer.Init() dict
+ call self.__superBufferInit()
+
+ setlocal noswapfile
+ setlocal buftype=nofile
+ setlocal bufhidden=wipe
+
+ call vimclojure#MapPlug("n", "p", "CloseResultBuffer")
+
+ call self.clear()
+ let leader = exists("g:maplocalleader") ? g:maplocalleader : "\\"
+ call append(0, "; Use " . leader . "p to close this buffer!")
+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(ns) dict
+ call self.__superResultBufferInit()
+ set filetype=clojure
+ let b:vimclojure_namespace = a:ns
+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! ClojureShellEscapeArgumentsWorker() dict
+ set noshellslash
+ return map(copy(self.vals), 'shellescape(v:val)')
+endfunction
+
+function! vimclojure#ShellEscapeArguments(vals)
+ let closure = {
+ \ 'vals': a:vals,
+ \ 'f' : function("ClojureShellEscapeArgumentsWorker")
+ \ }
+
+ return vimclojure#util#WithSavedOption('shellslash', 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,
+ \ '--nailgun-server', g:vimclojure#NailgunServer,
+ \ '--nailgun-port', g:vimclojure#NailgunPort,
+ \ '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#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
+ " some freedesktop thing, whatever, issue #67
+ let vimclojure#Browser = "xdg-open"
+ 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(b:vimclojure_namespace)
+ 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(b:vimclojure_namespace)
+ 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 [unused, 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(ns)
+ 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(ns)
+ 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(ns)
+ 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(ns)
+ 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(ns)
+ call resultBuffer.showOutput(result)
+ wincmd p
+endfunction
+
+function! vimclojure#EvalBlock()
+ let file = vimclojure#BufferName()
+ let ns = b:vimclojure_namespace
+
+ let content = vimclojure#util#Yank("l", 'normal! gv"ly')
+ let result = vimclojure#ExecuteNailWithInput("Repl", content,
+ \ "-r", "-n", ns, "-f", file, "-l", line("'<") - 1)
+
+ let resultBuffer = g:vimclojure#ClojureResultBuffer.New(ns)
+ call resultBuffer.showOutput(result)
+ wincmd p
+endfunction
+
+function! vimclojure#EvalToplevel()
+ let file = vimclojure#BufferName()
+ let ns = b:vimclojure_namespace
+ let [pos, 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(ns)
+ call resultBuffer.showOutput(result)
+ wincmd p
+endfunction
+
+function! ClojureEvalParagraphWorker() dict
+ normal! }
+ return line(".")
+endfunction
+
+function! vimclojure#EvalParagraph()
+ let file = vimclojure#BufferName()
+ let ns = b:vimclojure_namespace
+ let startPosition = line(".")
+
+ let closure = { 'f' : function("ClojureEvalParagraphWorker") }
+
+ let endPosition = vimclojure#util#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(ns)
+ call resultBuffer.showOutput(result)
+ wincmd p
+endfunction
+
+" The Repl
+let vimclojure#Repl = copy(vimclojure#Buffer)
+let vimclojure#Repl.__superBufferNew = vimclojure#Repl.New
+let vimclojure#Repl.__superBufferInit = vimclojure#Repl.Init
+let vimclojure#Repl.__superBufferClear = vimclojure#Repl.clear
+
+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
+
+" FIXME: Ugly hack. But easier than cleaning up the buffer
+" mess in case something goes wrong with repl start.
+function! vimclojure#Repl.New(namespace) dict
+ let replStart = vimclojure#ExecuteNail("Repl", "-s",
+ \ "-n", a:namespace)
+ if replStart.stderr != ""
+ call vimclojure#ReportError(replStart.stderr)
+ return
+ endif
+
+ let instance = call(self.__superBufferNew, [a:namespace], self)
+ let instance._id = replStart.value.id
+ call vimclojure#ExecuteNailWithInput("Repl",
+ \ "(require 'clojure.stacktrace)",
+ \ "-r", "-i", instance._id)
+
+ return instance
+endfunction
+
+function! vimclojure#Repl.Init(namespace) dict
+ call self.__superBufferInit()
+
+ let self._prompt = a:namespace . "=>"
+
+ setlocal buftype=nofile
+ setlocal noswapfile
+
+ call append(line("$"), ["Clojure", self._prompt . " "])
+
+ let b:vimclojure_repl = self
+
+ set filetype=clojure
+ let b:vimclojure_namespace = a:namespace
+
+ if !hasmapto("<Plug>ClojureReplEnterHook.", "i")
+ imap <buffer> <silent> <CR> <Plug>ClojureReplEnterHook.
+ endif
+ if !hasmapto("<Plug>ClojureReplEvaluate.", "i")
+ imap <buffer> <silent> <C-CR> <Plug>ClojureReplEvaluate.
+ endif
+ if !hasmapto("<Plug>ClojureReplHatHook.", "n")
+ nmap <buffer> <silent> ^ <Plug>ClojureReplHatHook.
+ endif
+ if !hasmapto("<Plug>ClojureReplUpHistory.", "i")
+ imap <buffer> <silent> <C-Up> <Plug>ClojureReplUpHistory.
+ endif
+ if !hasmapto("<Plug>ClojureReplDownHistory.", "i")
+ 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.clear() dict
+ call self.__superBufferClear()
+ call self.showPrompt()
+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#util#Yank("l", ln . "," . line("$") . "yank l")
+
+ let cmd = substitute(cmd, "^" . self._prompt . "\\s*", "", "")
+ let cmd = substitute(cmd, "\n$", "", "")
+ return cmd
+endfunction
+
+function! vimclojure#ReplDoEnter()
+ execute "normal! a\<CR>x"
+ normal! ==x
+ if getline(".") =~ '^\s*$'
+ startinsert!
+ else
+ startinsert
+ endif
+endfunction
+
+function! vimclojure#Repl.enterHook() dict
+ let lastCol = {}
+
+ function lastCol.f() dict
+ normal! g_
+ return col(".")
+ endfunction
+
+ if line(".") < line("$") || col(".") < vimclojure#util#WithSavedPosition(lastCol)
+ call vimclojure#ReplDoEnter()
+ return
+ endif
+
+ let cmd = self.getCommand()
+
+ " Special Case: Showed prompt (or user just hit enter).
+ if cmd =~ '^\(\s\|\n\)*$'
+ execute "normal! a\<CR>"
+ startinsert!
+ 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 == ""
+ call vimclojure#ReplDoEnter()
+ 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.hatHook() dict
+ let l = getline(".")
+
+ if l =~ "^" . self._prompt
+ let [buf, line, col, off] = getpos(".")
+ call setpos(".", [buf, line, len(self._prompt) + 2, off])
+ else
+ normal! ^
+ 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 /.*/
+ if a:000 == []
+ 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)
+ endif
+ endtry
+ endif
+ endif
+ endif
+endfunction
+
+function! vimclojure#AddToLispWords(word)
+ execute "setlocal lw+=" . a:word
+endfunction
+
+function! vimclojure#ToggleParenRainbow()
+ highlight clear clojureParen1
+ highlight clear clojureParen2
+ highlight clear clojureParen3
+ highlight clear clojureParen4
+ highlight clear clojureParen5
+ highlight clear clojureParen6
+ highlight clear clojureParen7
+ highlight clear clojureParen8
+ highlight clear clojureParen9
+
+ let g:vimclojure#ParenRainbow = !g:vimclojure#ParenRainbow
+
+ if g:vimclojure#ParenRainbow != 0
+ if &background == "dark"
+ highlight clojureParen1 ctermfg=yellow guifg=orange1
+ highlight clojureParen2 ctermfg=green guifg=yellow1
+ highlight clojureParen3 ctermfg=cyan guifg=greenyellow
+ highlight clojureParen4 ctermfg=magenta guifg=green1
+ highlight clojureParen5 ctermfg=red guifg=springgreen1
+ highlight clojureParen6 ctermfg=yellow guifg=cyan1
+ highlight clojureParen7 ctermfg=green guifg=slateblue1
+ highlight clojureParen8 ctermfg=cyan guifg=magenta1
+ highlight clojureParen9 ctermfg=magenta guifg=purple1
+ else
+ highlight clojureParen1 ctermfg=darkyellow guifg=orangered3
+ highlight clojureParen2 ctermfg=darkgreen guifg=orange2
+ highlight clojureParen3 ctermfg=blue guifg=yellow3
+ highlight clojureParen4 ctermfg=darkmagenta guifg=olivedrab4
+ highlight clojureParen5 ctermfg=red guifg=green4
+ highlight clojureParen6 ctermfg=darkyellow guifg=paleturquoise3
+ highlight clojureParen7 ctermfg=darkgreen guifg=deepskyblue4
+ highlight clojureParen8 ctermfg=blue guifg=darkslateblue
+ highlight clojureParen9 ctermfg=darkmagenta guifg=darkviolet
+ endif
+ else
+ highlight link clojureParen1 clojureParen0
+ highlight link clojureParen2 clojureParen0
+ highlight link clojureParen3 clojureParen0
+ highlight link clojureParen4 clojureParen0
+ highlight link clojureParen5 clojureParen0
+ highlight link clojureParen6 clojureParen0
+ highlight link clojureParen7 clojureParen0
+ highlight link clojureParen8 clojureParen0
+ highlight link clojureParen9 clojureParen0
+ endif
+endfunction
+
+" Epilog
+let &cpo = s:save_cpo
View
108 vim/autoload/vimclojure/util.vim
@@ -0,0 +1,108 @@
+" 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#util#SynIdName()
+ return synIDattr(synID(line("."), col("."), 0), "name")
+endfunction
+
+function! vimclojure#util#WithSaved(closure)
+ let v = a:closure.save()
+ try
+ let r = a:closure.f()
+ finally
+ call a:closure.restore(v)
+ endtry
+ return r
+endfunction
+
+function! s:SavePosition() dict
+ let [ _b, l, c, _o ] = getpos(".")
+ let b = bufnr("%")
+ return [b, l, c]
+endfunction
+
+function! s:RestorePosition(value) dict
+ let [b, l, c] = a:value
+
+ if bufnr("%") != b
+ execute b "buffer!"
+ endif
+ call setpos(".", [0, l, c, 0])
+endfunction
+
+function! vimclojure#util#WithSavedPosition(closure)
+ let a:closure.save = function("s:SavePosition")
+ let a:closure.restore = function("s:RestorePosition")
+
+ return vimclojure#util#WithSaved(a:closure)
+endfunction
+
+function! s:SaveRegister(reg)
+ return [a:reg, getreg(a:reg, 1), getregtype(a:reg)]
+endfunction
+
+function! s:SaveRegisters() dict
+ return map([self._register, "", "/", "-",
+ \ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
+ \ "s:SaveRegister(v:val)")
+endfunction
+
+function! s:RestoreRegisters(registers) dict
+ for register in a:registers
+ call call(function("setreg"), register)
+ endfor
+endfunction
+
+function! vimclojure#util#WithSavedRegister(reg, closure)
+ let a:closure._register = a:reg
+ let a:closure.save = function("s:SaveRegisters")
+ let a:closure.restore = function("s:RestoreRegisters")
+
+ return vimclojure#util#WithSaved(a:closure)
+endfunction
+
+function! s:SaveOption() dict
+ return eval("&" . self._option)
+endfunction
+
+function! s:RestoreOption(value) dict
+ execute "let &" . self._option . " = a:value"
+endfunction
+
+function! vimclojure#util#WithSavedOption(option, closure)
+ let a:closure._option = a:option
+ let a:closure.save = function("s:SaveOption")
+ let a:closure.restore = function("s:RestoreOption")
+
+ return vimclojure#util#WithSaved(a:closure)
+endfunction
+
+function! s:DoYank() dict
+ silent execute self.yank
+ return getreg(self.reg)
+endfunction
+
+function! vimclojure#util#Yank(r, how)
+ let closure = {
+ \ 'reg': a:r,
+ \ 'yank': a:how,
+ \ 'f': function("s:DoYank")
+ \ }
+
+ return vimclojure#util#WithSavedRegister(a:r, closure)
+endfunction
+
+function! vimclojure#util#MoveBackward()
+ call search('\S', 'Wb')
+endfunction
+
+function! vimclojure#util#MoveForward()
+ call search('\S', 'W')
+endfunction
+
+" Epilog
+let &cpo = s:save_cpo
1  vim/bundle/nerdtree
@@ -0,0 +1 @@
+Subproject commit a1433c485eb254838c1db52e087d5ec4d1e77cfd
View
20 vim/doc/LICENSE.txt
@@ -0,0 +1,20 @@
+Copyright 2008-2011 (c) Meikel Brandmeyer.
+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.
View
433 vim/doc/clojure.txt
@@ -0,0 +1,433 @@
+*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
+<
+The actual server to connect to and the port of said server can be given
+via configuration variables. The defaults are:
+>
+ let vimclojure#NailgunServer = "127.0.0.1"
+ let vimclojure#NailgunPort = "2113"
+<
+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'|).
+
+To customise the paren rainbow colors provide a from levels to the desired
+color definitions.
+>
+ let vimclojure#ParenRainbowColors = {
+ \ '1': 'guifg=green',
+ \ ...
+ \ }
+<
+This will be used for all settings of 'bg'. If you want to specify only
+for light resp. dark backgrounds, just add "Light" resp. "Dark" to the
+option name.
+
+Indenting *ft-clj-indent*
+---------
+
+VimClojure provides the (hopefully) correct indentation rules for
+the standard forms and macros. However user code might define also
+forms for which the indentation should follow the indentation according
+to the 'lispwords' option. The names of these forms often follow a
+pattern like "defsomething" or "with-something".
+
+By setting the fuzzy indent option, you can tell VimClojure, that you
+want names matching a fuzzy indent pattern to be indented as if they
+were included in the 'lispwords' option.
+>
+ let vimclojure#FuzzyIndent = 1
+<
+This option is disabled by default.
+
+Custom fuzzy indent patterns may be specified as normal regular expressions
+in the corresponding option. The patterns are matched against the leading
+symbol of the form in a way to ignore namespace aliases. The default
+patterns are “def.*”, “with.*” and “let.*”.
+
+For example, consider working a lot with core.logic. Then you may specify
+eg. “fresh” in .vim/after/ftplugin/clojure.vim.
+>
+ let vimclojure#FuzzyIndentPatterns .= ",fresh"
+<
+Note: this is a normal variable. So you have to use “.=” rather than
+“+=” and the comma separator has to be given explicitly.
+
+To be able to properly indent a given line there is some searching
+necessary to determine the surroundings of the cursor. In big files
+this my result in a slow down when entering a new line. So there is
+an option to basically limit the horizon which is searched for the
+indentation to synchronise. By default this is 100 lines backwards in
+the file. However you may specify whatever value works best for you.
+Higher values mean more searching.
+>
+ let vimclojure#SearchThreshold = 100
+<
+
+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, append a "." and your setting will override the default mapping.
+>
+ aucmd BufRead,BufNewFile *.clj nmap xyz <Plug>ClojureEvalToplevel.
+<
+To inhibit all mappings set the global flag to zero:
+>
+ let vimclojure#SetupKeyMap = 0
+<
+To inhibit only single mappings append the plug name:
+>
+ let vimclojure#SetupKeyMapEvalToplevel = 0
+<
+To enable only single mappings first turn off all flags, and then
+whitelist the ones you want to be enabled:
+>
+ let vimclojure#SetupKeyMap = 0
+ let vimclojure#SetupKeyMapEvalToplevel = 1
+<
+Whatever setting: it will still honor any key mapping made by yourself.
+
+<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.
+
+<LocalLeader>tr *tr* *ToggleParenRainbow*
+ Toggle the paren rainbow option. Note: After
+ toggling the default colors will be used. Not any
+ customised ones.
+
+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.
+
+A newline will also be inserted if you are inside of the expression. The
+expression will only be submitted to the Repl when you hit enter after
+the last character of the buffer. If you are inside the expression and
+want to start the evaluation immediately you may use <C-CR> instead of
+the plain <CR>.
+
+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.
+
+If the current line starts with a repl prompt, the *^* command moves to
+the end of the prompt and to the beginning of the line.
+
+The Plugs are:
+ - <Plug>ClojureReplEnterHook. for the enter key
+ - <Plug>ClojureReplEvaluate. for immediate evaluation (<C-CR>)
+ - <Plug>ClojureReplHatHook. for ^ navigation
+ - <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-2011 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 :
View
325 vim/doc/tags
@@ -1,269 +1,56 @@
-:MatchDebug matchit.txt /*:MatchDebug*
-:Snippet snippets_emu.txt /*:Snippet*
-:TComment tComment.txt /*:TComment*
-:TCommentAs tComment.txt /*:TCommentAs*
-:TCommentBlock tComment.txt /*:TCommentBlock*
-:TCommentInline tComment.txt /*:TCommentInline*
-:TCommentRight tComment.txt /*:TCommentRight*
-CreateBundleSnippet snippets_emu.txt /*CreateBundleSnippet*
-CreateSnippet snippets_emu.txt /*CreateSnippet*
-MatchError matchit.txt /*MatchError*
-TCommentDefineType() tComment.txt /*TCommentDefineType()*
-[% matchit.txt /*[%*
-]% matchit.txt /*]%*
-b:match_col matchit.txt /*b:match_col*
-b:match_debug matchit.txt /*b:match_debug*
-b:match_ignorecase matchit.txt /*b:match_ignorecase*
-b:match_ini matchit.txt /*b:match_ini*
-b:match_iniBR matchit.txt /*b:match_iniBR*
-b:match_match matchit.txt /*b:match_match*
-b:match_pat matchit.txt /*b:match_pat*
-b:match_skip matchit.txt /*b:match_skip*
-b:match_table matchit.txt /*b:match_table*
-b:match_tail matchit.txt /*b:match_tail*
-b:match_wholeBR matchit.txt /*b:match_wholeBR*
-b:match_word matchit.txt /*b:match_word*
-b:match_words matchit.txt /*b:match_words*
-basic-snippet snippets_emu.txt /*basic-snippet*
-config/rails.vim rails.txt /*config\/rails.vim*
-creating-snippets snippets_emu.txt /*creating-snippets*
-cs surround.txt /*cs*
-ds surround.txt /*ds*
-g% matchit.txt /*g%*
-g:loaded_rails rails.txt /*g:loaded_rails*
-g:rails_abbreviations rails.txt /*g:rails_abbreviations*
-g:rails_dbext rails.txt /*g:rails_dbext*
-g:rails_default_database rails.txt /*g:rails_default_database*
-g:rails_default_file rails.txt /*g:rails_default_file*
-g:rails_expensive rails.txt /*g:rails_expensive*
-g:rails_gnu_screen rails.txt /*g:rails_gnu_screen*
-g:rails_history_size rails.txt /*g:rails_history_size*
-g:rails_mappings rails.txt /*g:rails_mappings*
-g:rails_menu rails.txt /*g:rails_menu*
-g:rails_modelines rails.txt /*g:rails_modelines*
-g:rails_statusline rails.txt /*g:rails_statusline*
-g:rails_syntax rails.txt /*g:rails_syntax*
-g:rails_tabstop rails.txt /*g:rails_tabstop*
-g:rails_url rails.txt /*g:rails_url*
-g:tcommentMapLeader1 tComment.txt /*g:tcommentMapLeader1*
-g:tcommentMapLeader2 tComment.txt /*g:tcommentMapLeader2*
-g:tcommentMapLeaderOp1 tComment.txt /*g:tcommentMapLeaderOp1*
-g:tcommentMapLeaderOp2 tComment.txt /*g:tcommentMapLeaderOp2*
-g:tcommentOpModeExtra tComment.txt /*g:tcommentOpModeExtra*
-greplace.txt greplace.txt /*greplace.txt*
-i_CTRL-G_S surround.txt /*i_CTRL-G_S*
-i_CTRL-G_s surround.txt /*i_CTRL-G_s*
-macros/rails.vim rails.txt /*macros\/rails.vim*
-matchit matchit.txt /*matchit*
-matchit-% matchit.txt /*matchit-%*
-matchit-\1 matchit.txt /*matchit-\\1*
-matchit-activate matchit.txt /*matchit-activate*
-matchit-backref matchit.txt /*matchit-backref*
-matchit-bugs matchit.txt /*matchit-bugs*
-matchit-choose matchit.txt /*matchit-choose*
-matchit-configure matchit.txt /*matchit-configure*
-matchit-debug matchit.txt /*matchit-debug*
-matchit-details matchit.txt /*matchit-details*
-matchit-highlight matchit.txt /*matchit-highlight*
-matchit-hl matchit.txt /*matchit-hl*
-matchit-intro matchit.txt /*matchit-intro*
-matchit-languages matchit.txt /*matchit-languages*
-matchit-modes matchit.txt /*matchit-modes*
-matchit-newlang matchit.txt /*matchit-newlang*
-matchit-o_% matchit.txt /*matchit-o_%*
-matchit-parse matchit.txt /*matchit-parse*
-matchit-s:notend matchit.txt /*matchit-s:notend*
-matchit-s:sol matchit.txt /*matchit-s:sol*
-matchit-spaces matchit.txt /*matchit-spaces*
-matchit-troubleshoot matchit.txt /*matchit-troubleshoot*
-matchit-v_% matchit.txt /*matchit-v_%*
-matchit.txt matchit.txt /*matchit.txt*
-matchit.vim matchit.txt /*matchit.vim*
-named-tags snippets_emu.txt /*named-tags*
-o_[% matchit.txt /*o_[%*
-o_]% matchit.txt /*o_]%*
-o_g% matchit.txt /*o_g%*
-rails rails.txt /*rails*
-rails-'cfu' rails.txt /*rails-'cfu'*
-rails-'completefunc' rails.txt /*rails-'completefunc'*
-rails-'efm' rails.txt /*rails-'efm'*
-rails-'errorformat' rails.txt /*rails-'errorformat'*
-rails-'et' rails.txt /*rails-'et'*
-rails-'expandtab' rails.txt /*rails-'expandtab'*
-rails-'filetype' rails.txt /*rails-'filetype'*
-rails-'ft' rails.txt /*rails-'ft'*
-rails-'includeexpr' rails.txt /*rails-'includeexpr'*
-rails-'inex' rails.txt /*rails-'inex'*
-rails-'makeprg' rails.txt /*rails-'makeprg'*
-rails-'mp' rails.txt /*rails-'mp'*
-rails-'pa' rails.txt /*rails-'pa'*
-rails-'path' rails.txt /*rails-'path'*
-rails-'shiftwidth' rails.txt /*rails-'shiftwidth'*
-rails-'softtabstop' rails.txt /*rails-'softtabstop'*
-rails-'statusline' rails.txt /*rails-'statusline'*
-rails-'stl' rails.txt /*rails-'stl'*
-rails-'sts' rails.txt /*rails-'sts'*
-rails-'sua' rails.txt /*rails-'sua'*
-rails-'suffixesadd' rails.txt /*rails-'suffixesadd'*
-rails-'sw' rails.txt /*rails-'sw'*
-rails-:A rails.txt /*rails-:A*
-rails-:AE rails.txt /*rails-:AE*
-rails-:AS rails.txt /*rails-:AS*
-rails-:AT rails.txt /*rails-:AT*
-rails-:AV rails.txt /*rails-:AV*
-rails-:OpenURL rails.txt /*rails-:OpenURL*
-rails-:R rails.txt /*rails-:R*
-rails-:RE rails.txt /*rails-:RE*
-rails-:RS rails.txt /*rails-:RS*
-rails-:RT rails.txt /*rails-:RT*
-rails-:RV rails.txt /*rails-:RV*
-rails-:Rabbrev rails.txt /*rails-:Rabbrev*
-rails-:Rabbrev! rails.txt /*rails-:Rabbrev!*
-rails-:Rails rails.txt /*rails-:Rails*
-rails-:Rake rails.txt /*rails-:Rake*
-rails-:Rake! rails.txt /*rails-:Rake!*
-rails-:Rapi rails.txt /*rails-:Rapi*
-rails-:Rcd rails.txt /*rails-:Rcd*
-rails-:Rcommand rails.txt /*rails-:Rcommand*
-rails-:Rconsole rails.txt /*rails-:Rconsole*
-rails-:Rcontroller rails.txt /*rails-:Rcontroller*
-rails-:Rdbext rails.txt /*rails-:Rdbext*
-rails-:Rdbext! rails.txt /*rails-:Rdbext!*
-rails-:Rdestroy rails.txt /*rails-:Rdestroy*
-rails-:Rdoc rails.txt /*rails-:Rdoc*
-rails-:Rdoc! rails.txt /*rails-:Rdoc!*
-rails-:Redit rails.txt /*rails-:Redit*
-rails-:Rextract rails.txt /*rails-:Rextract*
-rails-:Rfind rails.txt /*rails-:Rfind*
-rails-:Rfixtures rails.txt /*rails-:Rfixtures*
-rails-:Rfunctionaltest rails.txt /*rails-:Rfunctionaltest*
-rails-:Rgenerate rails.txt /*rails-:Rgenerate*
-rails-:Rhelper rails.txt /*rails-:Rhelper*
-rails-:Rintegrationtest rails.txt /*rails-:Rintegrationtest*
-rails-:Rinvert rails.txt /*rails-:Rinvert*
-rails-:Rjavascript rails.txt /*rails-:Rjavascript*
-rails-:Rlayout rails.txt /*rails-:Rlayout*
-rails-:Rlcd rails.txt /*rails-:Rlcd*
-rails-:Rlib rails.txt /*rails-:Rlib*
-rails-:Rlog rails.txt /*rails-:Rlog*
-rails-:Rmigration rails.txt /*rails-:Rmigration*
-rails-:Rmodel rails.txt /*rails-:Rmodel*
-rails-:Rnavcommand rails.txt /*rails-:Rnavcommand*
-rails-:Robserver rails.txt /*rails-:Robserver*
-rails-:Rp rails.txt /*rails-:Rp*
-rails-:Rpartial rails.txt /*rails-:Rpartial*
-rails-:Rplugin rails.txt /*rails-:Rplugin*
-rails-:Rpp rails.txt /*rails-:Rpp*
-rails-:Rpreview rails.txt /*rails-:Rpreview*
-rails-:Rpreview! rails.txt /*rails-:Rpreview!*
-rails-:Rproject rails.txt /*rails-:Rproject*
-rails-:Rproject! rails.txt /*rails-:Rproject!*
-rails-:Rrefresh rails.txt /*rails-:Rrefresh*
-rails-:Rrefresh! rails.txt /*rails-:Rrefresh!*
-rails-:Rrunner rails.txt /*rails-:Rrunner*
-rails-:Rscript rails.txt /*rails-:Rscript*
-rails-:Rserver rails.txt /*rails-:Rserver*
-rails-:Rserver! rails.txt /*rails-:Rserver!*
-rails-:Rset rails.txt /*rails-:Rset*
-rails-:Rspec rails.txt /*rails-:Rspec*
-rails-:Rstylesheet rails.txt /*rails-:Rstylesheet*
-rails-:Rtags rails.txt /*rails-:Rtags*
-rails-:Rtask rails.txt /*rails-:Rtask*
-rails-:Runittest rails.txt /*rails-:Runittest*
-rails-:Rview rails.txt /*rails-:Rview*
-rails-:Ry rails.txt /*rails-:Ry*
-rails-:autocmd rails.txt /*rails-:autocmd*
-rails-@params rails.txt /*rails-@params*
-rails-abbreviations rails.txt /*rails-abbreviations*
-rails-about rails.txt /*rails-about*
-rails-alternate rails.txt /*rails-alternate*
-rails-alternate-related rails.txt /*rails-alternate-related*
-rails-autocommands rails.txt /*rails-autocommands*
-rails-commands rails.txt /*rails-commands*
-rails-configuration rails.txt /*rails-configuration*
-rails-controller-navigation rails.txt /*rails-controller-navigation*
-rails-cream rails.txt /*rails-cream*
-rails-custom-navigation rails.txt /*rails-custom-navigation*
-rails-dbext rails.txt /*rails-dbext*
-rails-gf rails.txt /*rails-gf*
-rails-global-settings rails.txt /*rails-global-settings*
-rails-install-plugin rails.txt /*rails-install-plugin*
-rails-install-vim rails.txt /*rails-install-vim*
-rails-installation rails.txt /*rails-installation*
-rails-integration rails.txt /*rails-integration*
-rails-introduction rails.txt /*rails-introduction*
-rails-license rails.txt /*rails-license*
-rails-menu rails.txt /*rails-menu*
-rails-merb rails.txt /*rails-merb*
-rails-migrations rails.txt /*rails-migrations*
-rails-misc-navigation rails.txt /*rails-misc-navigation*
-rails-model-navigation rails.txt /*rails-model-navigation*
-rails-modelines rails.txt /*rails-modelines*
-rails-navigation rails.txt /*rails-navigation*
-rails-options rails.txt /*rails-options*
-rails-partials rails.txt /*rails-partials*
-rails-plugin-author rails.txt /*rails-plugin-author*
-rails-project rails.txt /*rails-project*
-rails-rails-integration rails.txt /*rails-rails-integration*
-rails-refactoring rails.txt /*rails-refactoring*
-rails-related rails.txt /*rails-related*
-rails-rspec rails.txt /*rails-rspec*
-rails-screen rails.txt /*rails-screen*
-rails-scripts rails.txt /*rails-scripts*
-rails-slow rails.txt /*rails-slow*
-rails-snippets rails.txt /*rails-snippets*
-rails-surround rails.txt /*rails-surround*
-rails-syntax rails.txt /*rails-syntax*
-rails-syntax-assertions rails.txt /*rails-syntax-assertions*
-rails-syntax-classes rails.txt /*rails-syntax-classes*
-rails-syntax-deprecated rails.txt /*rails-syntax-deprecated*
-rails-syntax-keywords rails.txt /*rails-syntax-keywords*
-rails-syntax-strings rails.txt /*rails-syntax-strings*
-rails-syntax-yaml rails.txt /*rails-syntax-yaml*
-rails-tabs rails.txt /*rails-tabs*
-rails-template-types rails.txt /*rails-template-types*
-rails-vim-integration rails.txt /*rails-vim-integration*
-rails.txt rails.txt /*rails.txt*
-snip-advanced-tag-commands snippets_emu.txt /*snip-advanced-tag-commands*
-snip-buffer-specific snippets_emu.txt /*snip-buffer-specific*
-snip-bundles snippets_emu.txt /*snip-bundles*
-snip-contact-details snippets_emu.txt /*snip-contact-details*
-snip-contributors snippets_emu.txt /*snip-contributors*
-snip-detailed-explanations snippets_emu.txt /*snip-detailed-explanations*
-snip-elem-delimiter snippets_emu.txt /*snip-elem-delimiter*
-snip-ftplugin snippets_emu.txt /*snip-ftplugin*
-snip-limitations snippets_emu.txt /*snip-limitations*
-snip-menu snippets_emu.txt /*snip-menu*
-snip-remap-key snippets_emu.txt /*snip-remap-key*
-snip-snippet-commands snippets_emu.txt /*snip-snippet-commands*
-snip-special-vars snippets_emu.txt /*snip-special-vars*
-snip-start-end-tags snippets_emu.txt /*snip-start-end-tags*
-snip-tag-name-syntax snippets_emu.txt /*snip-tag-name-syntax*
-snippet-commands snippets_emu.txt /*snippet-commands*
-snippets_emu-bugs snippets_emu.txt /*snippets_emu-bugs*
-snippets_emu-features snippets_emu.txt /*snippets_emu-features*
-snippets_emu-options snippets_emu.txt /*snippets_emu-options*
-snippets_emu-troubleshooting snippets_emu.txt /*snippets_emu-troubleshooting*
-snippets_emu.txt snippets_emu.txt /*snippets_emu.txt*
-surround surround.txt /*surround*
-surround-author surround.txt /*surround-author*
-surround-customizing surround.txt /*surround-customizing*
-surround-issues surround.txt /*surround-issues*
-surround-mappings surround.txt /*surround-mappings*
-surround-replacements surround.txt /*surround-replacements*
-surround-targets surround.txt /*surround-targets*
-surround.txt surround.txt /*surround.txt*
-tComment-Installation tComment.txt /*tComment-Installation*
-tComment-Key-Bindings tComment.txt /*tComment-Key-Bindings*
-tComment-Usage tComment.txt /*tComment-Usage*
-tComment-commands tComment.txt /*tComment-commands*
-tComment.txt tComment.txt /*tComment.txt*
-v_[% matchit.txt /*v_[%*
-v_]% matchit.txt /*v_]%*
-v_a% matchit.txt /*v_a%*
-v_g% matchit.txt /*v_g%*
-vs surround.txt /*vs*
-yS surround.txt /*yS*
-ySS surround.txt /*ySS*
-ys surround.txt /*ys*
-yss surround.txt /*yss*
+AddToLispWords clojure.txt /*AddToLispWords*
+DocLookupInteractive clojure.txt /*DocLookupInteractive*
+DocLookupWord clojure.txt /*DocLookupWord*
+EvalBlock clojure.txt /*EvalBlock*
+EvalFile clojure.txt /*EvalFile*
+EvalLine clojure.txt /*EvalLine*
+EvalParagraph clojure.txt /*EvalParagraph*
+EvalToplevel clojure.txt /*EvalToplevel*
+FindDoc clojure.txt /*FindDoc*
+GotoSourceInteractive clojure.txt /*GotoSourceInteractive*
+GotoSourceWord clojure.txt /*GotoSourceWord*
+JavadocLookupInteractive clojure.txt /*JavadocLookupInteractive*
+JavadocLookupWord clojure.txt /*JavadocLookupWord*
+MacroExpand clojure.txt /*MacroExpand*
+MacroExpand1 clojure.txt /*MacroExpand1*
+MetaLookupInteractive clojure.txt /*MetaLookupInteractive*
+MetaLookupWord clojure.txt /*MetaLookupWord*
+RequireFile clojure.txt /*RequireFile*
+RequireFileAll clojure.txt /*RequireFileAll*
+RunTests clojure.txt /*RunTests*
+SourceLookupInteractive clojure.txt /*SourceLookupInteractive*
+SourceLookupWord clojure.txt /*SourceLookupWord*
+StartLocalRepl clojure.txt /*StartLocalRepl*
+StartRepl clojure.txt /*StartRepl*
+ToggleParenRainbow clojure.txt /*ToggleParenRainbow*
+^ clojure.txt /*^*
+aw clojure.txt /*aw*
+clj-nailgun-server clojure.txt /*clj-nailgun-server*
+clojure.vim clojure.txt /*clojure.vim*
+eb clojure.txt /*eb*
+ef clojure.txt /*ef*
+el clojure.txt /*el*
+ep clojure.txt /*ep*
+et clojure.txt /*et*
+fd clojure.txt /*fd*
+ft-clj-indent clojure.txt /*ft-clj-indent*
+ft-clj-syntax clojure.txt /*ft-clj-syntax*
+gi clojure.txt /*gi*
+gw clojure.txt /*gw*
+ji clojure.txt /*ji*
+jw clojure.txt /*jw*
+li clojure.txt /*li*
+lw clojure.txt /*lw*
+m1 clojure.txt /*m1*
+me clojure.txt /*me*
+mi clojure.txt /*mi*
+mw clojure.txt /*mw*
+rF clojure.txt /*rF*
+rf clojure.txt /*rf*
+rt clojure.txt /*rt*
+sR clojure.txt /*sR*
+si clojure.txt /*si*
+sr clojure.txt /*sr*
+sw clojure.txt /*sw*
+tr clojure.txt /*tr*
+vimclojure.txt clojure.txt /*vimclojure.txt*
View
1  vim/ftdetect/clojure.vim
@@ -0,0 +1 @@
+au BufNewFile,BufRead *.clj set filetype=clojure
View
147 vim/ftplugin/clojure.vim
@@ -0,0 +1,147 @@
+" 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! ClojureGetFoldingLevelWorker() dict
+ execute self.lineno
+
+ if vimclojure#util#SynIdName() =~ 'clojureParen\d' && vimclojure#util#Yank('l', 'normal! "lyl') == '('
+ return 1
+ endif
+
+ if searchpairpos('(', '', ')', 'bWr', 'vimclojure#util#SynIdName() !~ "clojureParen\\d"') != [0, 0]
+ return 1
+ endif
+
+ return 0
+endfunction
+
+function! ClojureGetFoldingLevel(lineno)
+ let closure = {
+ \ 'lineno' : a:lineno,
+ \ 'f' : function("ClojureGetFoldingLevelWorker")
+ \ }
+
+ 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#MapPlug("n", "tr", "ToggleParenRainbow")
+
+call vimclojure#MapPlug("n", "lw", "DocLookupWord")
+call vimclojure#MapPlug("n", "li", "DocLookupInteractive")
+call vimclojure#MapPlug("n", "jw", "JavadocLookupWord")
+call vimclojure#MapPlug("n", "ji", "JavadocLookupInteractive")
+call vimclojure#MapPlug("n", "fd", "FindDoc")
+
+call vimclojure#MapPlug("n", "mw", "MetaLookupWord")
+call vimclojure#MapPlug("n", "mi", "MetaLookupInteractive")
+
+call vimclojure#MapPlug("n", "sw", "SourceLookupWord")
+call vimclojure#MapPlug("n", "si", "SourceLookupInteractive")
+
+call vimclojure#MapPlug("n", "gw", "GotoSourceWord")
+call vimclojure#MapPlug("n", "gi", "GotoSourceInteractive")
+
+call vimclojure#MapPlug("n", "rf", "RequireFile")
+call vimclojure#MapPlug("n", "rF", "RequireFileAll")
+
+call vimclojure#MapPlug("n", "rt", "RunTests")
+
+call vimclojure#MapPlug("n", "me", "MacroExpand")
+call vimclojure#MapPlug("n", "m1", "MacroExpand1")
+
+call vimclojure#MapPlug("n", "ef", "EvalFile")
+call vimclojure#MapPlug("n", "el", "EvalLine")
+call vimclojure#MapPlug("v", "eb", "EvalBlock")
+call vimclojure#MapPlug("n", "et", "EvalToplevel")
+call vimclojure#MapPlug("n", "ep", "EvalParagraph")
+
+call vimclojure#MapPlug("n", "sr", "StartRepl")
+call vimclojure#MapPlug("n", "sR", "StartLocalRepl")
+
+if exists("b:vimclojure_namespace")
+ setlocal omnifunc=vimclojure#OmniCompletion
+
+ augroup VimClojure
+ au!
+ autocmd CursorMovedI <buffer> if pumvisible() == 0 | pclose | endif
+ augroup END
+endif
+
+call vimclojure#MapPlug("n", "p", "CloseResultBuffer")
+
+let &cpo = s:cpo_save
View
544 vim/ftplugin/clojure/completions-clojure.core.txt
@@ -0,0 +1,544 @@
+*agent*
+*allow-unresolved-vars*
+*assert*
+*clojure-version*
+*command-line-args*
+*compile-files*
+*compile-path*
+*err*
+*file*
+*flush-on-newline*
+*fn-loader*
+*in*
+*math-context*
+*ns*
+*out*
+*print-dup*
+*print-length*
+*print-level*
+*print-meta*
+*print-readably*
+*read-eval*
+*source-path*
+*unchecked-math*
+*use-context-classloader*
+*verbose-defrecords*
+*warn-on-reflection*
+->>
+-cache-protocol-fn
+-reset-methods
+EMPTY-NODE
+accessor
+aclone
+add-classpath
+add-watch
+agent
+agent-error
+agent-errors
+aget
+alength
+alias