Last Updated: February 25, 2016
·
889
· nvie

Quickly ack, open and search for a term

I've come to love fish shell recently. In it, I've defined this va alias that is super-helpful for quickly finding, opening and highlighting a term in a file:

function va
    ack -li -- "$argv" ^/dev/null | xargs -o vim -c "/$argv"
end

The equivalent in POSIX shells of course is:

va () {
    ack -li -- "$@" 2>/dev/null | xargs -o vim -c "/$@"
}