Use this vim command to show the doc of any entities `:Nitdoc Object`.
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
endfun
" Show doc for the entity under the cursor in the preview window
endfun
" Show doc for the entity under the cursor in the preview window
-fun Nitdoc()
- " Word under cursor
- let word = expand("<cword>")
+fun Nitdoc(...)
+ if a:0 == 0 || empty(a:1)
+ " Word under cursor
+ let word = expand("<cword>")
+ else
+ let word = join(a:000, ' ')
+ endif
" All possible docs (there may be more than one entity with the same name)
let docs = []
" All possible docs (there may be more than one entity with the same name)
let docs = []
" Activate the omnifunc on Nit files
autocmd FileType nit set omnifunc=NitOmnifunc
" Activate the omnifunc on Nit files
autocmd FileType nit set omnifunc=NitOmnifunc
+" Define the user command Nitdoc for ease of use
+command -nargs=* Nitdoc call Nitdoc("<args>")
+
let s:script_dir = fnamemodify(resolve(expand('<sfile>:p')), ':h')
let s:script_dir = fnamemodify(resolve(expand('<sfile>:p')), ':h')