@haruyama の Clojure 開発環境

春山 征吾(@haruyama)

lein + Vim

lein

{:user  {:plugins {
                   lein-difftest "2.0.0"
                   lein-pprint   "1.1.1"
                   lein-localrepo "0.4.1"
                   jonase/eastwood "0.0.2"
                   }
         :search-page-size 30
         ; :repl-options  {:prompt  (fn  [ns]  (str "your command, master? "))}
        }}

自動テスト

while inotifywait -e CLOSE_WRITE **/*/ || true; do lein test; done

Vim

setl tabstop=2 expandtab shiftwidth=2 softtabstop=2 smarttab

call vimshell#set_dictionary_helper(g:vimshell_interactive_interpreter_commands, 'clojure', 'lein repl')

vnoremap <buffer> <silent> ,s :VimShellSendString<CR>
vnoremap <buffer> <silent> <CR> :VimShellSendStringAndMove<CR>

autocmd BufWritePre *.{clj,cljs}  call RTrim()

if exists('*PareditInitBuffer')
  call PareditInitBuffer()
  nnoremap <SID>(toggle-paredit) :<C-u>call PareditToggle()<CR>
  nmap <buffer> <Leader>4 <SID>(toggle-paredit)
endif

setl includeexpr=substitute(substitute(v:fname,'/.*$','',''),'\\.','/','g')
setl path+=src;/,test;/
setl suffixesadd=.clj,cljs

"if exists('g:loaded_jump2clj')
"  setl includeexpr=jump2clj#jump('gf')
"  noremap fg :call jump2clj#jump('vne')<ENTER>
"endif

nnoremap <buffer> <silent> ,r :call Ref('clojure')<Enter>

Vim plugins