# Vim syntax highlighting for Ansible YAML files

**URL:** <https://forum.ansible.com/t/vim-syntax-highlighting-for-ansible-yaml-files/45637>\
**Category:** Get Help\
**Tags:** vim\
**Created:** [April 6, 2026, 4:24pm UTC](https://forum.ansible.com/t/vim-syntax-highlighting-for-ansible-yaml-files/45637 "2026-04-06T16:24:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [April 6, 2026, 4:24pm UTC](https://forum.ansible.com/t/vim-syntax-highlighting-for-ansible-yaml-files/45637/1 "2026-04-06T16:24:20Z")

</div>

Continuing the discussion from [vi editor for Ansible playbook](https://forum.ansible.com/t/vi-editor-for-ansible-playbook/37164/2):

> [@vi editor for Ansible playbook](https://forum.ansible.com/t/vi-editor-for-ansible-playbook/37164/2):
>
> Maybe you want [GitHub - pearofducks/ansible-vim: A vim plugin for syntax highlighting Ansible's common filetypes · GitHub](https://github.com/pearofducks/ansible-vim)

There was a new release today for `ansible-vim`:

> **[Release Neovim and Treesitter support · pearofducks/ansible-vim](https://github.com/pearofducks/ansible-vim/releases/tag/4.0)**
>
> Neovim now has first class support via Treesitter instead of traditional regex based highlights!
> This should hopefully improve both highlight performance in (very) large files as well as indent rel...

I use Ansible to install this plugin:

```yaml
    - name: Ansible Vim
      ansible.builtin.git:
        repo: https://github.com/pearofducks/ansible-vim.git
        dest: ~/.vim/bundle/ansible-vim
        depth: 1
        version: "4.0"

```

And this is loaded via `pathogen`:

```yaml
    - name: Vim pathogen Debian file copied
      ansible.builtin.copy:
        src: /usr/share/vim-pathogen/autoload/pathogen.vim
        dest: ~/.vim/autoload/pathogen.vim
        remote_src: true
        mode: "0600" 

```

And this requires the Debian `vim-pathogen` apt package to be installed.
