Skip to content

Commit

Permalink
some clojure stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
locojaydev committed Jun 5, 2012
1 parent acd1eaa commit fcfaef8
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 4 deletions.
33 changes: 33 additions & 0 deletions compiler/cake-test-wrapper.py
@@ -0,0 +1,33 @@
#!/usr/bin/env python

import os, subprocess

def parse_filename(l):
ns = l.split(' ', 3)[-1].rsplit('/', 1)[0]
return os.path.join('./test', *ns.split('.')) + '.clj'

def process_error(fn, l, lines):
lnum = int(l.rsplit(' ', 1)[-1].split(':')[-1])

message = lines.pop(0)

print '%s:%d:%s' % (fn, lnum, message)

return message

if __name__ == '__main__':
out = subprocess.check_output(r"cake test | perl -pe 's/\e\[?.*?[\@-~]//g'", shell=True)

prev = ""
fn = None
lines = out.splitlines()
while lines:
l = lines.pop(0)
if l.startswith('cake test ') and '/' in l:
fn = parse_filename(l)

if l.startswith('FAIL!'):
prev = process_error(fn, l, lines)
else:
prev = l

20 changes: 20 additions & 0 deletions compiler/clojure.vim
@@ -0,0 +1,20 @@
"============================================================================
"Compiler: Clojure (cake test)
"Maintainer: Steve Losh <steve@stevelosh.com>
"License: MIT/X11
"============================================================================

" if exists("current_compiler")
" finish
" endif
let current_compiler = "clojure"

let s:cpo_save = &cpo
set cpo-=C"endif

let &l:makeprg=fnameescape(globpath(&runtimepath, 'compiler/cake-test-wrapper.py'))

setlocal errorformat=%f:%l:%m

let &cpo = s:cpo_save
unlet s:cpo_save
24 changes: 21 additions & 3 deletions vimrc
Expand Up @@ -177,6 +177,11 @@ set wildignore+=*.o,*.obj,*.pyc,*.class "compiled files, bytecode
set wildignore+=*.DS_Store
set wildignore+=*.pdf,*.xls,*.xlsx,*.doc
set wildignore+=*.jar
" Lein
set wildignore+=classes
set wildignore+=lib




"Move lines up and down
Expand Down Expand Up @@ -305,6 +310,11 @@ if has("autocmd")
endif
"Clojure"
" autocmd FileType clojure set ts=2 sts=2 sw=2 expandtab
autocmd FileType clojure compiler clojure

"clojurescript
autocmd BufNewFile,BufRead *.cljs set filetype=clojurescript

"
"Css
autocmd Filetype css set omnifunc=csscomplete#CompleteCSS
Expand Down Expand Up @@ -741,9 +751,6 @@ Bundle 'tpope/vim-repeat.git'
Bundle 'tpope/vim-surround.git'
Bundle 'tpope/vim-speeddating.git'

"Editing
"Bundle 'vim-scripts/delimitMate.vim'
Bundle 'kana/vim-smartinput'

"Task Management
"Bundle 'jceb/vim-orgmode'
Expand Down Expand Up @@ -782,13 +789,24 @@ if has('ruby')
" autocmd BufWritePost *.rst :Hammer<CR>
endif

"Editing
"Bundle 'vim-scripts/delimitMate.vim'
Bundle 'kana/vim-smartinput'


"Clojusre
Bundle 'VimClojure'
"Highlight Clojure's builtins
let g:vimclojure#HighlightBuiltins=1
"Rainbow parentheses'!
let g:vimclojure#ParenRainbow=1

" Bundle 'vim-scripts/slimv.vim'
" Bundle 'gberenfield/sjl-slimv'
" let g:slimv_leader = '\'
" let g:lisp_rainbow = 1
" let g:slimv_repl_syntax = 1



"help
Expand Down
2 changes: 1 addition & 1 deletion vundle

0 comments on commit fcfaef8

Please sign in to comment.