The Archives

  • 23.Jul.12
    gdb & nice Vim macro shell | fernape | (0)
    Imagine we have a simple program like the one below: #include <stdio.h> int main(int argc, char **argv) { char *str = "Hello guys, this is just a bit large string to test a nice Vim macro"; printf("%s\n", str); return (0); } This program is pretty simple, but it will serve its purpose. Imagine we have to inspect the content of str or for the same matter, any other memory address. We want to do it while we are inside a gdb session or while we are analyzing a core file. The simplest case is to do ...
  • 23.Oct.10
    Vim. Macros shell | fernape | (0)
    You have probably seen something like this in other editors. Macros (or "complex repetitions" as Vim's help puts it) is a way to repeat complex commands sequences. In order to get the most out of this feature, you need to master movement and insertion commands. The work cycle is the following: start recording, execute commands, stop recording. Then, you are ready to execute the whole sequence of commands you have recorded. Let us see this in more detail. To start recording, we use the "q" command followed by a register name in which the sequence of commands will be stored. qa At that ...