> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/troubleshooting-and-resources/armory/general/configuring-vim-editor-to-work-with-yaml.md).

# Configuring VIM editor to work with YAML

### Introduction <a href="#introduction" id="introduction"></a>

Spinnaker configs are in YAML. It is best to set up VIM to auto-indent properly so that there are less syntax errors due to tab insertion and/or spacing problems.

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

VIM

### Instructions <a href="#instructions" id="instructions"></a>

### For files that end with .yaml or .yml <a href="#for-files-that-end-with-yaml-or-yml" id="for-files-that-end-with-yaml-or-yml"></a>

Create or update `~/.vimrc` file with the following: syntax enable filetype on autocmd FileType yaml,yml setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0# indentkeys-=

### For arbitrary files <a href="#for-arbitrary-files" id="for-arbitrary-files"></a>

The following comment can be added to the top of any file to let VIM know what configuration it should use `# vim: set shiftwidth=2 tabstop=2 softtabstop=2 expandtab:`

### Fix files that have a mix of tabs and spaces to all spaces <a href="#fix-files-that-have-a-mix-of-tabs-and-spaces-to-all-spaces" id="fix-files-that-have-a-mix-of-tabs-and-spaces-to-all-spaces"></a>

In VIM's command mode enter the following

## to go to command mode hit the Esc key <a href="#to-go-to-command-mode-hit-the-esc-key" id="to-go-to-command-mode-hit-the-esc-key"></a>

:set shiftwidth=2 tabstop=2 softtabstop=2 expandtab :retab
