diff --git a/plugin/foreplay.vim b/plugin/foreplay.vim index d070218..9b56fc2 100644 --- a/plugin/foreplay.vim +++ b/plugin/foreplay.vim @@ -704,6 +704,10 @@ function! s:Edit(cmd, keyword) abort return 'echoerr v:errmsg' endfunction +nnoremap ForeplayDjump :exe Edit('edit', expand('')) +nnoremap ForeplayDsplit :exe Edit('split', expand('')) +nnoremap ForeplayDtabjump :exe Edit('tabedit', expand('')) + augroup foreplay_source autocmd! autocmd FileType clojure setlocal includeexpr=tr(v:fname,'.-','/_') @@ -711,11 +715,11 @@ augroup foreplay_source autocmd FileType clojure setlocal define=^\\s*(def\\w* autocmd FileType clojure command! -bar -buffer -nargs=1 -complete=customlist,foreplay#eval_complete Djump :exe s:Edit('edit', ) autocmd FileType clojure command! -bar -buffer -nargs=1 -complete=customlist,foreplay#eval_complete Dsplit :exe s:Edit('split', ) - autocmd FileType clojure nnoremap [ :exe Edit('edit', expand('')) - autocmd FileType clojure nnoremap ] :exe Edit('edit', expand('')) - autocmd FileType clojure nnoremap :exe Edit('split', expand('')) - autocmd FileType clojure nnoremap d :exe Edit('split', expand('')) - autocmd FileType clojure nnoremap gd :exe Edit('tabedit', expand('')) + autocmd FileType clojure nmap [ ForeplayDjump + autocmd FileType clojure nmap ] ForeplayDjump + autocmd FileType clojure nmap ForeplayDsplit + autocmd FileType clojure nmap d ForeplayDsplit + autocmd FileType clojure nmap gd ForeplayDtabedit augroup END " }}}1 @@ -875,11 +879,14 @@ function! s:K() endif endfunction +nnoremap ForeplayK :=K() +nnoremap ForeplaySource :Source + augroup foreplay_doc autocmd! - autocmd FileType clojure nnoremap K :=K() - autocmd FileType clojure nnoremap [d :Source - autocmd FileType clojure nnoremap ]d :Source + autocmd FileType clojure nmap K ForeplayK + autocmd FileType clojure nmap [d ForeplaySource + autocmd FileType clojure nmap ]d ForeplaySource autocmd FileType clojure command! -buffer -nargs=1 Apropos :exe s:Apropos() autocmd FileType clojure command! -buffer -nargs=1 FindDoc :exe s:Lookup('clojure.repl', 'find-doc', printf('#"%s"', )) autocmd FileType clojure command! -buffer -bar -nargs=1 Javadoc :exe s:Lookup('clojure.java.javadoc', 'javadoc', )