**Prerequisites**: Complete the [Bash Basics](/tutorials/bash/) tutorial first, or be comfortable with Linux command line.
---
## What is Slurm?
When you log into DAIC, you land on a **login node**. This is a shared computer where users prepare their work - but you shouldn't run computations here. The actual computing happens on **compute nodes**, powerful machines with GPUs and lots of memory.
@@ -723,8 +738,43 @@ After your first successful run, check `seff` and adjust requests.
Learn the Vim text editor for efficient file editing on DAIC.
---
## What you'll learn
By the end of this tutorial, you'll be able to:
- Open, edit, save, and quit files in Vim
- Navigate efficiently without touching the mouse
- Delete, copy, and paste text
- Search and replace
- Edit SLURM scripts and Python code on the cluster
**Time**: About 30 minutes
**Prerequisites**: Basic familiarity with command line. Complete [Bash Basics](/tutorials/bash/) first if you're new to Linux.
---
## Why learn Vim?
When working on DAIC, you'll often need to edit files directly on the cluster - tweaking a batch script, fixing a bug in your code, or checking a configuration file. Since DAIC is accessed via SSH (no graphical interface), you need a terminal-based text editor.
@@ -724,8 +739,54 @@ Then gradually add new commands as the basic ones become automatic.
| `cw` | Change word |
| `.` | Repeat last change |
## Summary
You've learned the essential Vim workflow:
| Task | Commands |
|------|----------|
| Open a file | `vim filename` |
| Enter insert mode | `i`, `a`, `o` |
| Return to normal mode | `Esc` |
| Save | `:w` |
| Quit | `:q` or `:wq` |
| Navigate | `hjkl`, `w`, `b`, `gg`, `G` |
| Delete | `x`, `dd`, `dw` |
| Copy/paste | `yy`, `p` |
| Undo/redo | `u`, `Ctrl+r` |
| Search | `/pattern`, `n`, `N` |
| Replace | `:%s/old/new/g` |
| Select lines | `V` + movement |
## Exercises
Practice these tasks to build muscle memory:
### Exercise 1: Basic editing
Create a new file, add three lines of text, save and quit. Then reopen it and verify your changes.
### Exercise 2: Navigation
Open a Python file and practice: go to end (`G`), go to beginning (`gg`), jump by words (`w`, `b`), go to specific line (`10G`).
### Exercise 3: Delete and undo
Open a file, delete a line (`dd`), undo (`u`), delete a word (`dw`), undo again.
### Exercise 4: Copy and paste
Copy a line (`yy`), move to a new location, paste it (`p`). Then try with multiple lines using `V`.
### Exercise 5: Search and replace
Open a file and search for a word (`/word`). Then replace all occurrences of one word with another (`:%s/old/new/g`).
### Exercise 6: Real task
Edit a SLURM batch script: change the time limit, add a new `#SBATCH` directive, and save.
## Keep learning
- Run `vimtutor` for a 30-minute interactive tutorial
- Practice daily - even small edits help build muscle memory
- Add one new command to your repertoire each week
## Next steps
- Practice with `vimtutor`
-[Slurm Tutorial](/tutorials/slurm/) - Submit jobs
-[Apptainer Tutorial](/tutorials/apptainer/) - Use containers
-[Slurm Tutorial](/tutorials/slurm/) - Submit jobs to the cluster
-[Apptainer Tutorial](/tutorials/apptainer/) - Package your environment