Joined July 2012
·
Posted to
Vim: Edit Files that Grep finds
over 1 year
ago
Or alternatively could use ack, as it's a whole lot better than grep (http://betterthangrep.com/):
ack -l "pattern" | vim -
Posted to
`cat` syntax highlighting
over 1 year
ago
Great tip. I wrapped this up in another script where I use pygmentize if the file is recognizable by Pygments, and lolcat (https://github.com/busyloop/lolcat) if the file is not (I called this "cat.sh" and in my bashrc I alias cat to cat.sh):
#!/bin/sh
# if no file specified default to lolcat reading on stdin
if [ $# -eq 0 ]; then
lolcat
else
TYPE=$(pygmentize -N $1)
if [ $TYPE = "text" ]; then
lolcat $1
else
pygmentize $1
fi
fi
It's also in Github: https://github.com/pzelnip/dotfiles/blob/master/bin/cat.sh
Achievements
104 Karma
0 Total ProTip Views

Velociraptor
Have at least one original repo where Perl is the dominant language

Komodo Dragon 3
Have at least three original repos where Java is the dominant language

Charity
Fork and commit to someone's open source project in need

Komodo Dragon
Have at least one original repo where Java is the dominant language

Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos

Forked
Have a project valued enough to be forked by someone else

Python 3
Have at least three original repos where Python is the dominant language

Python
Would you expect anything less? Have at least one original repo where Python is the dominant language

T-Rex
Have at least one original repo where C is the dominant language

Raven
Have at least one original repo where some form of shell script is the dominant language
Great idea, too bad that textbelt doesn't seem to support non-US carriers.