@haruyama の Clojure 開発環境 その2

春山 征吾(@haruyama)

前回の資料

@haruyama の Clojure 開発環境

lein + Vim

lein

{:user  {:plugins [[lein-kibit "0.0.8"]
                   [lein-difftest "2.0.0"]
                   [lein-pprint   "1.1.1"]
                   [lein-localrepo "0.4.1"]
                   [jonase/eastwood "0.0.2"]]
         :search-page-size 30
         }}

静的解析

自動テスト

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

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

Vim plugins