GUIDE 03 / EVERYDAY COMMANDS
Vim & editing
Move between modes, save safely, and find the text you need.
Commands use class paths and example filenames. Replace placeholders and inspect the target before making changes.
Open a file
Vim starts in Normal mode. Press i to enter Insert mode and type. Press Esc to return to Normal mode before entering editing commands.
vim ~/.bashrc
vim ~/scripts/shell/health-check.shOn a Mac using zsh, interactive shell customizations usually belong in ~/.zshrc. Check echo "$SHELL" and the shell you are actually running before choosing a startup file.
Save or leave
Type these commands in Normal mode. :w saves, :q quits, and :wq does both. :q! discards unsaved edits.
:w
:q
:wq
:q!The leading colon opens the Vim command line; these are Vim commands, not shell commands.
Search and navigate
Use /text followed by Enter to search forward. n repeats the search; N reverses direction. gg goes to the first line and G to the last line.
:set number
:52
/if curl
:set pasteFor terminal paste problems, :set paste can help on terminals without bracketed paste support; turn it off with :set nopaste afterward.
Check scripts after editing
A syntax check catches unmatched quotes, missing fi or done, and incomplete loops before the script runs. An error near the end can originate much earlier.
bash -n ~/scripts/shell/health-check.sh
nl -ba ~/scripts/shell/health-check.sh | lessCopy commands from code blocks. Markdown link syntax such as [label](URL) does not belong in a shell script.