Skip to content

Instantly share code, notes, and snippets.

@byung-u
Last active July 20, 2017 06:38
Show Gist options
  • Save byung-u/3fe934691b68edb764c7905549a02abc to your computer and use it in GitHub Desktop.
Save byung-u/3fe934691b68edb764c7905549a02abc to your computer and use it in GitHub Desktop.
# I wanna make `grep` result like this
#
# % jgrep pStStps *.c
#
# vi -R MS_Stf.c +1006 if (!HINSERT(HTbl[T->i], &pStStps->lkey, 0, pStStps))
# vi -R MS_Stf.c +1009 pStStps->lkey, errno);
# vi -R MS_Stf.c +1010 CancelEvent(T->pool, pStStps->iTimer);
# vi -R MS_Stf.c +1011 free(pStStps);
# vi -R MS_Stf.c +1014 return pStStps;
alias jgrep 'grep -Hn \!* | sed "s/^/vi -R /g" | sed "/:/{s/:/\ +/}" | sed "/:/{s/:/\ /}"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment