pearofducks / ansible-vim

A vim plugin for syntax highlighting Ansible's common filetypes
MIT License
800 stars 98 forks source link

:Ansibledoc function and command #89

Closed westurner closed 3 years ago

westurner commented 4 years ago

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?

westurner commented 4 years ago

There's probably a better way to accomplish this:

https://vim.fandom.com/wiki/Display_output_of_shell_commands_in_new_window

pearofducks commented 4 years ago

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.