blinky-vim

Rehosted with Paul's permission

Here's the code for blinky-vim. blinky-vim makes the cursor blink in vim. There's some code that makes the cursor blink, but I don't like having the cursor blink on the command line, only in vim. So I took it, changed it, made it my own. Well, and Pete's own. And Rob's own. And now, your own. The first part is the C code to blink the cursor:

#include <signal.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> void Int() { printf("\e[?25h"); fflush(stdout); exit(1); } main() { FILE *blinkout; blinkout = fopen("/tmp/blinkout", "w"); fprintf(blinkout, "%d", getpid()); fclose(blinkout); if(signal(SIGINT, Int) == SIG_ERR) { perror("signal"); exit(-1); } while (1) { printf("\e[?25h"); fflush(stdout); usleep(400000); /* on time */ printf("\e[?25l"); fflush(stdout); usleep(250000); /* off time */ } }

And here's the shell script that turns it on before launching vim, and kills it off afterward:

#!/bin/sh /home/pscherm1/bin/blink & pid=`/bin/cat /tmp/blinkout` rm /tmp/blinkout /usr/bin/vi $1 #echo $pid kill -2 $pid


Here's Pete Rijks's patch to make the cursor beep, as well.
And here's Rob Minerick's man page.