Skip to content

Small neovim plugin to make working with Ansible playbooks or roles more convenient

Notifications You must be signed in to change notification settings

Wnthr/nvim-ansible

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvim-ansible

Installation

git clone \
    https://github.com/mfussenegger/nvim-ansible.git \
    ~/.config/nvim/pack/plugins/start/nvim-ansible

Usage

Small plugin to make working with Ansible playbooks or roles more convenient:

  • Adds ftdetect pattern to recognize playbooks/roles and set filetype to yaml.ansible.
  • Sets keywordprg to ansible-doc if available
  • Sets path to be able to jump to files using gf which are files/ next to a tasks/ role file.
  • Provides a run() function to execute playbooks or roles using ansible-playbook or ansible localhost -m import_role. See :help ansible

You may want to setup keymaps for the run() function, for example in ftplugin/ansible.lua add:

vim.keymap.set('v', '<leader>te', function() require('ansible').run() end, { buffer = true, silent = true })
vim.keymap.set('n', '<leader>te', ":w<CR> :lua require('ansible').run()<CR>", { buffer = true, silent = true })

Best used together with ansible-language-server

About

Small neovim plugin to make working with Ansible playbooks or roles more convenient

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 98.7%
  • Vim Script 1.3%