Skip to main content
Back to Extensions Directory
coc.nvim fallback icon

@yaegassy/coc-ansible

yaegassy

ansible-language-server extension for coc.nvim

Installation CommandVim prompt
:CocInstall @yaegassy/coc-ansible
GitHub owner
yaegassy
Version
v0.15.2
Requirements
coc ^0.0.80
License
MIT
Repository
GitHub
npm latest published 2026-06-21Registry checked 2026-08-23Registry summary

Published Package Summary

coc-ansible

ansible-language-server extension for coc.nvim

coc-ansible-demo

Install

CocInstall:

:CocInstall @yaegassy/coc-ansible

scoped packages

vim-plug:

Plug 'yaegassy/coc-ansible', {'do': 'yarn install --frozen-lockfile'}

Note

[!! Very important !!] Filetype related

  1. The "filetype" must be yaml.ansible for this extension to work.

    If you install ansible's vim plugin, yaml.ansible filetype will be added automatically, which is very useful (e.g. pearofducks/ansible-vim or sheerun/vim-polyglot).

  2. You also need to set g:coc_filetype_map in .vimrc/init.vim.

    let g:coc_filetype_map = {
      \ 'yaml.ansible': 'ansible',
      \ }
    

Requirements (Tools)

  • Ansible 2.9+
  • Ansible Lint (required, unless you disable linter support)
    • [TIPS] coc-ansible will automatically disable the feature if ansible-lint is not found
  • yamllint (optional)

If you also install yamllint, ansible-lint will detect it and incorporate into the linting process. Any findings reported by yamllint will be exposed in coc.nvim as errors/warnings.

Bult-in install

coc-ansible allows you to create an extension-only "venv" and install ansible, ansible-lint and yamllint.

yamllint will be installed by setting ansible.builtin.isWithYamllint to true (default: false).

You can also specify the version of each tool. (setting: ansible.bultin.ansibleVersion, ansible.bultin.ansibleLintVersion, ansible.bultin.yamllintVersion)


The first time you use coc-ansible, if ansible, ansible-lint is not detected, you will be prompted to do a built-in installation.

You can also run the installation command manually.

:CocCommand ansible.builtin.installRequirementsTools

Code Actions

Example key mapping (Code Action related):

nmap <silent> ga <Plug>(coc-codeaction-line)

Usage:

In the line with diagnostic message, enter the mapped key (e.g. ga) and you will see a list of code actions that can be performed.

Actions:

  • Ignoring rules for current line (# noqa [ruleId]) | DEMO
    • Requires ansible-lint "v6.8.1" or later.
  • Show web documentation for [ruleId] | DEMO
    • Requires ansible-lint "v6.8.1" or later.

Thanks

License

MIT


This extension is built with create-coc-extension

Read the complete README
  • ansible-language-server extension for coc.nvim
Activation Events
  • onLanguage:ansible
  • onLanguage:yaml.ansible
Developer Resources

Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.

Open Developer Guide

Version History

This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.