0

How would I do the above? Would it be different for each text editor? Could it be done in the terminal? Thanks

  • Do you just want to grep the file looking for the method names? – slm Oct 24 '13 at 22:13
  • Yea, not sure what you mean by "highlight". Maybe you're referring to color schemes? – Roberto Navarro Oct 24 '13 at 23:02
  • Are you using a text editor (if so, which) or the command line? – Gilles 'SO- stop being evil' Oct 24 '13 at 23:32
  • Command line. I think grep is the right direction (I'm pretty new), but what would be the exact command to find all occurrences of a method in a file? Idk if there is difference between finding a method or just any plain text block – user49888 Oct 24 '13 at 23:45
  • 1
    @user49888 What language are the methods being written in? What's the syntax that identifies a method from other similar constructs? – Joseph R. Oct 25 '13 at 0:37
3

If you are using a text editor, use your text editor's search command. For example, in vim, use / followed by the text you want to search for, and press Enter. Pressing n goes to the next occurrence.

If you want to list all occurrences from the command line, use grep:

grep myMethodName filename.c

If you want a prettier display than grep, and more features, try ack:

ack myMethodName filename.c
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.