Profile picture
Sidharth R
  • Home
  • Posts
  • Journal
  • Home
  • Posts
  • Journal
  • Search

Vim Config for CKA, CKS, CKAD Exam

Updated: 27 Apr 2026 ⚬ Page views: loading...

YAML is similar to Python in one very important way - indentation matters.

Kubernetes configs are written in YAML, and YAML is extremely strict about indentation (just like Python).

The CKA, CKS, CKAD exams are timebound & stressful.

So, you don’t want to waste time by encountering YAML errors.

Why do you need to change config?

By default, Vim inserts tab character (\t) when you press the tab key on your keyboard.

But Tabs (\t) are completely invalid in YAML.

Example error you’ll see:

found character '\t' that cannot start any token

So the rule is simple:

Always use spaces. Never tab.

Does YAML require 2 spaces or 4 spaces for indentation?

Both are valid. YAML only requires:

  • consistent indentation
  • spaces only

But 2 spaces in Kubernetes is widely used since official docs uses 2 spaces.

Config

Put this in your .vimrc:

set expandtab
set tabstop=2
set shiftwidth=2

Settings explained:

  • expandtab: use spaces for tab
  • tabstop: amount of spaces used for tab
  • shiftwidth: amount of spaces used during indentation

The above config will already be configured in your real exam environment in ~/.vimrc. But it’s never a bad idea to double check.

Nerdsid.com

Links
  • Home
  • Contact
  • About
  • Posts
  • Journal
  • Quotes
  • Links worth your time
  • Notes
  • Style guide
© 2026 Sidharth R.
All content on this website is licensed under CC BY-NC-SA 4.0.