Kill :Apropos

This is broken for anything namespaced.  REPL-y's find-name is better,
but nonstandard.
This commit is contained in:
Tim Pope 2014-05-05 15:24:26 -04:00
parent ac88f17bb4
commit 29af4adc46
3 changed files with 1 additions and 25 deletions

View File

@ -88,7 +88,7 @@ can be easily accessed with `:lopen`.
I was brand new to Clojure when I started this plugin, so stuff that helped me
understand code was a top priority.
* `:Source`, `:Doc`, `:FindDoc`, and `:Apropos`, which map to the underlying
* `:Source`, `:Doc`, and `:FindDoc`, which map to the underlying
`clojure.repl` macro (with tab complete, of course).
* `K` is mapped to look up the symbol under the cursor with `doc`.

View File

@ -59,9 +59,6 @@ K Look up docs for keyword under cursor.
*fireplace-:FindDoc*
:FindDoc {arg} Wrapper around (clojure.repl/find-doc ...).
*fireplace-:Apropos*
:Apropos {arg} Wrapper around (clojure.repl/apropos ...).
*fireplace-:Source*
:Source {symbol} Show the source for the given symbol.

View File

@ -1344,26 +1344,6 @@ function! s:inputlist(label, entries) abort
endif
endfunction
function! s:Apropos(pattern) abort
if a:pattern =~# '^#\="'
let pattern = a:pattern
elseif a:pattern =~# '^^'
let pattern = '#"' . a:pattern . '"'
else
let pattern = '"' . a:pattern . '"'
endif
let matches = fireplace#evalparse('(clojure.repl/apropos '.pattern.')')
if empty(matches)
return ''
endif
let choice = s:inputlist('Look up docs for:', matches)
if choice !=# ''
return 'echo "\n"|Doc '.choice
else
return ''
endif
endfunction
function! s:Doc(symbol) abort
let info = fireplace#info(a:symbol)
if has_key(info, 'ns') && has_key(info, 'name')
@ -1396,7 +1376,6 @@ augroup fireplace_doc
autocmd FileType clojure nmap <buffer> K <Plug>FireplaceK
autocmd FileType clojure nmap <buffer> [d <Plug>FireplaceSource
autocmd FileType clojure nmap <buffer> ]d <Plug>FireplaceSource
autocmd FileType clojure command! -buffer -nargs=1 Apropos :exe s:Apropos(<q-args>)
autocmd FileType clojure command! -buffer -nargs=1 FindDoc :exe s:Lookup('clojure.repl', 'find-doc', printf('#"%s"', <q-args>))
autocmd FileType clojure command! -buffer -bar -nargs=1 Javadoc :exe s:Lookup('clojure.java.javadoc', 'javadoc', <q-args>)
autocmd FileType clojure command! -buffer -bar -nargs=1 -complete=customlist,fireplace#eval_complete Doc :exe s:Doc(<q-args>)