Configuring your text editor for Ansible
Since YAML is highly sensitive to indentation, you need to take extra care while developing and editing playbooks using your text editor. You can use any text editor of your choice to edit Ansible playbooks and configure the editor as needed.
If you can use a GUI editor such as Visual Studio Code or Atom, skip this section as GUI editors can easily be configured with multiple plugins to perform Ansible content development more efficiently. Please refer to https://docs.ansible.com/ansible/latest/community/other_tools_and_programs.html to find details about tools and programs for Ansible content development. Now, let’s learn how to configure the Vim editor for Ansible YAML files. Use Vim variables to enable or disable the features in the Vim editor:
[ansible@ansible Chapter-02]$ vim install-package.yaml
Now, press Esc followed by : and type set nu
to enable line numbers, as shown in the following screenshot: