Skip to content

Instantly share code, notes, and snippets.

@int3
int3 / gist:812244
Created February 5, 2011 05:40
wrap jsctags and ctags for taglist.vim. see http://discontinuously.com/2011/01/jsctags-and-taglist-vim/
#! /usr/bin/env perl
if (!grep { $_ eq "--language-force=javascript" } @ARGV) { system("ctags " . join(" ", @ARGV)); exit; }
system("jsctags -o taglist " . pop() . " > /dev/null");
open(F, "taglist");
while(<F>) {
if ($_ =~ /!_TAG_/) { next; }
else { $_ =~ s/(\S+)(.*)lineno:(\d+)\ttype:(\w+) function\(([^)]*)\)/\1(\5) \4\2line:\3/; }
print $_;
}