Appearance
Vim Shortcuts for CKA
In the CKA exam, you don't have VS Code. You have a terminal and vim. Speed is your only friend. Mastering these specific keystrokes will save you ~10 minutes, which is enough time to answer 2 extra questions.
1. The "Setup" (.vimrc)
Before you start the exam, run this instantly. It fixes the terrible default indentation behavior when pasting YAML.
bash
echo "set expandtab" >> ~/.vimrc
echo "set tabstop=2" >> ~/.vimrc
echo "set shiftwidth=2" >> ~/.vimrc
echo "set autoindent" >> ~/.vimrc2. Navigation (Movement)
Stop pressing j twenty times.
G: Go to Bottom of file.gg: Go to Top of file.$: Go to End of line.0: Go to Start of line.w/b: Jump forward/backward by Word.50G: Go to line 50 (useful when error log says "error on line 50").
3. Editing (Action Mode)
o: Open new line BELOW cursor and enter Insert mode.O: Open new line ABOVE cursor.dd: Delete (Cut) current line.5dd: Delete 5 lines.u: Undo. (The most important key).Ctrl + r: Redo.
4. Bulk Actions (YAML Editing)
Deleting a whole block of "status" fields in a copied YAML:
- Move cursor to start of block.
- Press
V(Shift+v) for Visual Line Mode. - Press
jto select lines down. - Press
dto delete.
5. Indenting Blocks (The YAML Fixer)
Vselect the lines.>to indent right (add 2 spaces).<to indent left (remove 2 spaces).