Skip to content

Instantly share code, notes, and snippets.

@tynovsky
Created September 8, 2012 12:07
Show Gist options
  • Save tynovsky/3674258 to your computer and use it in GitHub Desktop.
Save tynovsky/3674258 to your computer and use it in GitHub Desktop.
open file in gvim's tab
#!/usr/bin/perl
use strict;
use warnings;
my $editor = "gvim --remote-tab";
my $linenum_param = "+";
my $linenum_separ = q{ : };
my $command;
if (@ARGV == 1 && $ARGV[0] =~ m{ (.*) $linenum_separ (.*) }xms) {
my $filename = $1;
my $line_number = $2;
$command = $editor . " "
. $linenum_param . $line_number . " "
. $filename;
}
else {
$command = "$editor @ARGV";
}
#$command .= " 2>&1 > /dev/null";
print $command, "\n";
exec($command);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment