Make vim Yours: A vimrc vim Can Verify
MediumText Editors15-20 minEvery vim session on this box should start the way the team works. Create root's personal vimrc: the file /root/.vimrc (or /root/.vim/vimrc, vim reads either).
/root/case/assignment.env gives this session's indent width, a function key and an option (they differ per session). The vimrc must make vim start with:
1. Indentation that many columns wide, using spaces: tabstop and shiftwidth both set to it, and expandtab on.
2. Smart search: ignorecase and smartcase both on.
3. A Normal-mode mapping: pressing the key toggles the option on, and pressing it again toggles it off.
Grading starts vim with your vimrc, asks vim what it ended up with, then presses the key. Any correct spelling passes. /root/case/brief.txt shows how to check yourself the same way.
- Persist options in ~/.vimrc
- Tell tabstop, shiftwidth and expandtab apart
- Write a Normal-mode mapping that runs a command
- Verify a vimrc from the command line
Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.
