Joined July 2012
·

Adam Parkin

Victoria, BC
·
·
·

Great idea, too bad that textbelt doesn't seem to support non-US carriers.

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