Mercurial > dotfiles.old
annotate bin/git-conflict @ 156:49e483d88403
Add autosuggestions to zsh
author | zegervdv <zegervdv@me.com> |
---|---|
date | Thu, 23 Oct 2014 08:45:15 +0200 |
parents | faf7781dae42 |
children |
rev | line source |
---|---|
6 | 1 #!/usr/bin/env perl |
2 # Find conflict markers in files | |
3 # 2013, Zeger Van de Vannet | |
4 | |
5 use Term::ANSIColor; | |
6 | |
7 my $files = `git ls-files`; | |
8 | |
9 my @files = split "\n", $files; | |
10 | |
11 for $file (@files) { | |
12 open FILE, "$file" or die $!; | |
13 my @lines = <FILE>; | |
14 for $i (keys @lines) { | |
31
faf7781dae42
Only show conflict markers when more than 3 <
zegervdv <zegervdv@me.com>
parents:
6
diff
changeset
|
15 if ($lines[$i] =~ /\<{3,}/) { |
6 | 16 $linenr = $i + 1; |
17 print color("blue"), "$file", color("reset"); | |
18 print ":"; | |
19 print color("yellow"), "$linenr ", color("reset"); | |
20 print "$lines[$i]"; | |
21 } | |
22 } | |
23 close FILE; | |
24 } |