@@ -7,6 +7,7 @@ augroup END
7
7
8
8
function ! s: set_up_eval () abort
9
9
command ! - buffer - bang -range =0 -nargs =? Eval :exe s: Eval (<bang> 0 , <line1> , <line2> , <count> , <q-args> )
10
+ command ! - buffer - bar -nargs =1 -complete =customlist ,fireplace#eval_complete Doc :exe s: Doc (<q-args> )
10
11
11
12
nmap <buffer> cp <Plug> FireplacePrint
12
13
nmap <buffer> cpp <Plug> FireplaceCountPrint
@@ -17,6 +18,8 @@ function! s:set_up_eval() abort
17
18
nmap <buffer> cqp <Plug> FireplacePrompt
18
19
19
20
map! <buffer> <C-R> ( <Plug> FireplaceRecall
21
+
22
+ nmap <buffer> K <Plug> FireplaceK
20
23
endfunction
21
24
22
25
if ! exists (' s:qffiles' )
@@ -107,3 +110,24 @@ endfunction
107
110
augroup fireplace_bindings
108
111
autocmd FileType hy call s: set_up_eval ()
109
112
augroup END
113
+
114
+ function ! s: Doc (symbol) abort
115
+ let info = fireplace#info (a: symbol )
116
+ if has_key (info, ' ns' ) && has_key (info, ' name' )
117
+ echo info.ns . ' ' . info.name
118
+ elseif has_key (info, " name" )
119
+ echo info.name
120
+ endif
121
+ if get (info, ' arglists-str' , ' nil' ) !=# ' nil'
122
+ echo info[' arglists-str' ]
123
+ endif
124
+ if ! empty (get (info, ' doc' , ' ' ))
125
+ echo " \n " . info.doc
126
+ endif
127
+ return ' '
128
+ endfunction
129
+
130
+ function ! s: K () abort
131
+ let word = expand (' <cword>' )
132
+ return ' Doc ' .word
133
+ endfunction
0 commit comments