Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mfussenegger/nvim-ansible
Small neovim plugin to make working with Ansible playbooks or roles more convenient
https://github.com/mfussenegger/nvim-ansible
ansible neovim neovim-plugin
Last synced: 7 days ago
JSON representation
Small neovim plugin to make working with Ansible playbooks or roles more convenient
- Host: GitHub
- URL: https://github.com/mfussenegger/nvim-ansible
- Owner: mfussenegger
- Created: 2022-11-22T19:13:11.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-17T08:38:10.000Z (27 days ago)
- Last Synced: 2024-10-19T11:36:50.389Z (25 days ago)
- Topics: ansible, neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 12.7 KB
- Stars: 41
- Watchers: 5
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nvim-ansible
## Installation
```bash
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:
```lua
vim.keymap.set('v', 'te', function() require('ansible').run() end, { buffer = true, silent = true })
vim.keymap.set('n', 'te', ":w :lua require('ansible').run()", { buffer = true, silent = true })
```Best used together with [ansible-language-server](https://github.com/ansible/ansible-language-server)