mirror of
https://github.com/gryf/.vim.git
synced 2025-12-17 19:40:29 +01:00
Update of plugins (vimwiki, ctrlp, syntastic, tagbar, gundo and mark),
added draft syntax file for kickassembler
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
# with the quickfix mode of Vim
|
||||
#
|
||||
# Copyright (<28>) 2001 by J<>rg Ziefle <joerg.ziefle@gmx.de>
|
||||
# Copyright (c) 2012 Eric Harmon <http://eharmon.net>
|
||||
# You may use and distribute this software under the same terms as Perl itself.
|
||||
#
|
||||
# Usage: put one of the two configurations below in your ~/.vimrc (without the
|
||||
@@ -13,25 +14,27 @@
|
||||
# Program is run interactively with 'perl -w':
|
||||
#
|
||||
# set makeprg=$HOME/bin/vimparse.pl\ %\ $*
|
||||
# set errorformat=%f:%l:%m
|
||||
# set errorformat=%t:%f:%l:%m
|
||||
#
|
||||
# Program is only compiled with 'perl -wc':
|
||||
#
|
||||
# set makeprg=$HOME/bin/vimparse.pl\ -c\ %\ $*
|
||||
# set errorformat=%f:%l:%m
|
||||
# set errorformat=%t:%f:%l:%m
|
||||
#
|
||||
# Usage:
|
||||
# vimparse.pl [-c] [-f <errorfile>] <programfile> [programargs]
|
||||
# vimparse.pl [-c] [-w] [-f <errorfile>] <programfile> [programargs]
|
||||
#
|
||||
# -c compile only, don't run (perl -wc)
|
||||
# -w output warnings as warnings instead of errors (slightly slower)
|
||||
# -f write errors to <errorfile>
|
||||
#
|
||||
# Example usages:
|
||||
# * From the command line:
|
||||
# vimparse.pl program.pl
|
||||
#
|
||||
# vimparse.pl -c -f errorfile program.pl
|
||||
# vimparse.pl -c -w -f errorfile program.pl
|
||||
# Then run vim -q errorfile to edit the errors with Vim.
|
||||
# This uses the custom errorformat: %t:%f:%l:%m.
|
||||
#
|
||||
# * From Vim:
|
||||
# Edit in Vim (and save, if you don't have autowrite on), then
|
||||
@@ -39,6 +42,9 @@
|
||||
# to error check.
|
||||
#
|
||||
# Version history:
|
||||
# 0.3 (05/31/2012):
|
||||
# * Added support for the seperate display of warnings
|
||||
# * Switched output format to %t:%f:%l:%m to support error levels
|
||||
# 0.2 (04/12/2001):
|
||||
# * First public version (sent to Bram)
|
||||
# * -c command line option for compiling only
|
||||
@@ -64,11 +70,11 @@
|
||||
use strict;
|
||||
use Getopt::Std;
|
||||
|
||||
use vars qw/$opt_c $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars'
|
||||
use vars qw/$opt_c $opt_w $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars'
|
||||
|
||||
use constant VERSION => 0.2;
|
||||
|
||||
getopts('cf:h');
|
||||
getopts('cwf:h');
|
||||
|
||||
&usage if $opt_h; # not necessarily needed, but good for further extension
|
||||
|
||||
@@ -86,20 +92,33 @@ my $handle = (defined $opt_f ? \*FILE : \*STDOUT);
|
||||
(my $file = shift) or &usage; # display usage if no filename is supplied
|
||||
my $args = (@ARGV ? ' ' . join ' ', @ARGV : '');
|
||||
|
||||
my @lines = `perl @{[defined $opt_c ? '-c ' : '' ]} -w "$file$args" 2>&1`;
|
||||
my @error_lines = `perl @{[defined $opt_c ? '-c ' : '' ]} @{[defined $opt_w ? '-X ' : '-w ']} "$file$args" 2>&1`;
|
||||
|
||||
my @lines = map { "E:$_" } @error_lines;
|
||||
|
||||
my @warn_lines;
|
||||
if(defined($opt_w)) {
|
||||
@warn_lines = `perl @{[defined $opt_c ? '-c ' : '' ]} -w "$file$args" 2>&1`;
|
||||
}
|
||||
|
||||
# Any new errors must be warnings
|
||||
foreach my $line (@warn_lines) {
|
||||
if(!grep { $_ eq $line } @error_lines) {
|
||||
push(@lines, "W:$line");
|
||||
}
|
||||
}
|
||||
|
||||
my $errors = 0;
|
||||
foreach my $line (@lines) {
|
||||
|
||||
chomp($line);
|
||||
my ($file, $lineno, $message, $rest);
|
||||
my ($file, $lineno, $message, $rest, $severity);
|
||||
|
||||
if ($line =~ /^(.*)\sat\s(.*)\sline\s(\d+)(\.|,\snear\s\".*\")$/) {
|
||||
|
||||
($message, $file, $lineno, $rest) = ($1, $2, $3, $4);
|
||||
if ($line =~ /^(.*)\sat\s(.*)\sline\s(\d+)(.*)$/) {
|
||||
($severity, $message, $file, $lineno, $rest) = ($1, $2, $3, $4, $5);
|
||||
$errors++;
|
||||
$message .= $rest if ($rest =~ s/^,//);
|
||||
print $handle "$file:$lineno:$message\n";
|
||||
print $handle "$severity:$file:$lineno:$message\n";
|
||||
|
||||
} else { next };
|
||||
|
||||
@@ -129,9 +148,10 @@ sub usage {
|
||||
(local $0 = $0) =~ s/^.*\/([^\/]+)$/$1/; # remove path from name of program
|
||||
print<<EOT;
|
||||
Usage:
|
||||
$0 [-c] [-f <errorfile>] <programfile> [programargs]
|
||||
$0 [-c] [-w] [-f <errorfile>] <programfile> [programargs]
|
||||
|
||||
-c compile only, don't run (executes 'perl -wc')
|
||||
-c compile only, don't run (executes 'perl -c')
|
||||
-w output warnings as warnings instead of errors (slightly slower)
|
||||
-f write errors to <errorfile>
|
||||
|
||||
Examples:
|
||||
@@ -139,8 +159,9 @@ Examples:
|
||||
$0 program.pl
|
||||
Displays output on STDOUT.
|
||||
|
||||
$0 -c -f errorfile program.pl
|
||||
$0 -c -w -f errorfile program.pl
|
||||
Then run 'vim -q errorfile' to edit the errors with Vim.
|
||||
This uses the custom errorformat: %t:%f:%l:%m.
|
||||
|
||||
* In Vim:
|
||||
Edit in Vim (and save, if you don't have autowrite on), then
|
||||
|
||||
Reference in New Issue
Block a user