vi editor for Ansible playbook

Hi All,

Could anyone please direct me what options i need to use/enable for while writing playbooks in vi editor colour indication lines as mentioned attached example.

Thank you in advance.

(attachments)

Maybe you want https://github.com/pearofducks/ansible-vim

Attached is my vimrc file. Place it in ~/.vimrc. This also maps F7 to toggle syntax highlighting. VIM has syntax aware code. You just need to enable it.

Walter

(attachments)

vimrc (164 Bytes)

Thank you for your assistance. I have just applied what you suggested but I still see there is no coloring format for my anisble playbooks. Please see attached file and request to suggest if something I’m missing.

Thank you again for your time.

(attachments)

I see it for vimrc

:if exists(“syntax_on”) | syntax off | else | syntax on | endif

What distro/environment are you using? Typically with Red Hat-based distros you need the vim-enhanced package installed for colour syntax highlighting.

It is in Linux server

It is in Linux server

Ubuntu? Red Hat? CentOS? What version? Linux Server is not specific.

Walter

There are a number of different variants or flavours of Linux. (https://en.wikipedia.org/wiki/List_of_Linux_distributions)

If the variant you’re using is based on Red Hat (e.g. Fedora, CentOS or similar) then you may need the additional vim-enhanced RPM installed. (Check with a local administrator if you’re unsure.)

Check the contents of /etc/os-release, that should give some indication of OS flavour (type) for most common distros.

Sorry.

It is red hat entrprise Linux 7.9

It helps I will check it out for rpm install.

Thank you for quick help and providing details.