pearofducks / ansible-vim

A vim plugin for syntax highlighting Ansible's common filetypes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

:Ansibledoc function and command

westurner opened this issue · comments

There's probably a better way to accomplish this:

" :Ansibledoc -- Replace the current buffer with the output of ansible-doc
"     :Ansibledoc file
"     :Ansibledoc -s file
"     :Ansibledoc -l
"     :Ansibledoc -F
function! Ansibledoc(...)
    execute "%!COLUMNS='$(tput cols)' ansible-doc " . join(a:000)
    set filetype=yaml
endfunction
command! -nargs=* Ansibledoc call Ansibledoc(<f-args>) 

Is ansible-vim a syntax-only vim plugin?

This is primarily a syntax plugin, outside of the snippets generation.

I'd be happy to either have this function in the README for users to manually add/manage, or to link to a plugin that provides this functionality.

If you have a suggestion/preference, let me know.

Unless you feel there will be a lot more features/changes added to the function in the future, I think this could live in the README.