You probably know you can type `break function_name` (this places a break at the START of the function). Not so useful for concurrency when you might be switching in and out of functions all the time. More useful is `break filename.c:XX`, where XX is line number.
(gdb) break producerconsumer.c:28
Breakpoint 5 at 0x80002bf8: file ../../asst1/producerconsumer.c, line 28.
(gdb) break producerconsumer.c:56
Breakpoint 6 at 0x80002dfc: file ../../asst1/producerconsumer.c, line 56.
Also check out backtrace (bt) and list (l)
To manipulate code at the speed of thought.
It is the same reason that we learn to touch-type — to write at the speed of thought.
gg
: go to the top of the file
G
: go to the bottom of the file
b
: go back a word
f
: go forward a word
$
: teleport to the start of the line, 0
: teleport to the end.
- replace everything within 2 parenthesis? no worries, it's natural: change in ( = "change in brackets" – duh!
Beyond being able to manipulate code on your own computer very quickly, the benefit of learning Vim is that you can manipulate code on any machine really quickly.