Do not waste time with grep anymore, use tag
Long time since my last post. This one is not very technical post, but it’s a nice to have solution if you use grep usually. Are not you fed up to type vim
First of all, you may know that an alternative more user friendly to grep exist, called ag (perf comparison). I really like ag and grep, but something make me loose my time since several years and I’m pretty sure it’s your case too.
Let’s say you generally want to parse files, find the information and jump with vim into it. With tag (using ag only) you can do it in only 2 commands. Let say I want to search my username in /etc:
$ sudo tag pmavro /etc/ /etc/mailname  1:mbp-pmavro /etc/gshadow  18*::pmavro  19*::pmavro  22*::pmavro,pulse  23*::pmavro  33*::pmavro  35*::pmavro  47!::pmavro  53!::pmavro  54!::  60!::pmavro
Now if I want to edit /etc/gshadow at line 54 with vim, I only have to type in the terminal:
“e” will read a temporary file containing the result and 10 will ask vim to position in the file to the matching line number.
User friendly and really simple right ?
Hope this will help