Hi everyone, I’m practicing for my Kubernetes exams and I keep hitting “indentation hell” in Vim. When I try to fix lines using shift+> or < in visual mode, things get even more misaligned (see attached image).
It’s taking up way too much of my lab time. I’ve tried :set paste and :set list, but I’m still struggling to keep my containers and volumeMounts aligned.
- How do you all handle massive YAML blocks quickly without losing the structure?
- What are your “must-have”
.vimrc settings that are allowed in the actual exam environment?
candidates that have given CKA exam did you’ll set up .vimrc if yes then what all to include

this is already present in kodekloud lab
Always watch the indentation of the YAML while copying and pasting.
YAML is super sensitive to indentation. When copying and pasting YAML blocks:
-
Check the starting indentation of the block you’re copying.
-
Place your cursor at the exact same level in your target file before pasting.
This should place your block at desired location with proper indentation.
i kept exactly were i was supposed to keep but after doing set paste also name of conatiner is pasted properly but the image and all below that the indentation is not properly pasted and i used shift+v selected below from image till end and did shift+> and bought it to alignment and after that i did k apply -f file.yaml it gave me error no proper indentation
It would have helped if you had shared the complete screenshot of the manifest.
Assuming this one is for a Pod or a Deployment, the whole yaml indentation is messed up in the screenshot.
I would suggest following examples in the official Kubernetes docs for Kubernetes manifests, and our guide specifically for yaml
A lot of this just comes down to practice. You need to get quite a lot of practice with:
- Using Visual Mode to select lines you need to indent.
- Use “>” and “<” to start an indentation, and “.” to redo an indentation.
If you only do it very occasionally, you’ll make mistakes. But if every time you need to add a block to a deployment or a pod, you practice this, you’ll have the muscle memory you need to do it dependably.
when i did : set list ^I ^ I THE i 's appeared in yaml file
so i found (googled)
:retab which clear al that i’s will it work in CKA final exam