Skip to content

Plugin to view Ansible module documentation within Vim/Neovim

License

Notifications You must be signed in to change notification settings

takelley1/ansible-doc.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ansible-doc.vim

View Ansible documentation without leaving Vim.

Installation

Use your favorite plugin manager, such as vim-plug:

Plug 'takelley1/ansible-doc.vim'

Usage

Run one of the following commands when your cursor is over the name of an Ansible module:

Command Description
:AnsibleDocFloat Open documentation in a floating window (Neovim only),
:AnsibleDocSplit ..or in a horizontal split,
:AnsibleDocVSplit ..or a vertical split.

You can map these commands however you like, such as:

nnoremap <leader>d :AnsibleDocFloat<CR>C-L>
nnoremap <leader>v :AnsibleDocVSplit<CR>C-L>

The following mappings are available in windows and splits created by this plugin:

Mapping Description
<space> Page-down
b Page-up
q, Q, <CR>, or <Esc> Close window

Options

Enable/disable extra key mappings (default is 1):

let g:ansibledoc_extra_mappings = 1

Modify the floating window's size and position (default is below):

  let g:ansibledoc_float_opts = {
    \ 'relative': 'editor',
    \ 'style': 'minimal',
    \ 'width': float2nr(round(0.45 * &columns)),
    \ 'height': float2nr(round(0.75 * &lines)),
    \ 'col': float2nr(round(0.27 * &columns)),
    \ 'row': float2nr(round(0.07 * &lines)),
    \ }

Enable/disable text wrapping in windows created by this plugin (default is 0):

let g:ansibledoc_wrap_text = 0

About

Plugin to view Ansible module documentation within Vim/Neovim

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published