Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you search through your own libraries of source code?

I write/modify code in multiple file formats like perl, html, css, php, javascript, autohotkey script, ... etc.

I often search my personal library of source code for examples of syntax or complex logic for reuse in new code. Or, I will search through a directory tree for code references to a particular string (e.g. all references to a particular css style within perl, php, html, and javascript). Sometimes I even search for cryptic strings like =~, because I am searching for a particular regular expression in one of my perl programs.

Sometimes I search existing code using copernic, but unfortunately it can only search for words and automatically ignores any programming syntax. Windows 7 file search seems worse than Windows XP file search.

My question is... How do you search through your own libraries of source code?

like image 390
panofish Avatar asked Jan 26 '10 20:01

panofish


People also ask

How do I search for a file in source code?

In case you want to search for code in a specific repository, select Project Home > Source Code, select a repository you want to search, click Browse Repository, and select the Search tab. You can search all files in a repository or narrow your scope to specific file types such as C, C++, C# and so on.

What is a source code library?

In computer science, source code is a sequence of statements of computer programming languages. Source code allows programmers to communicate with computers using several predefined commands. The source code library is software that supports programming language codes and has a built-in library of lines of code.


1 Answers

I used to use the find | xargs grep trick until I found ack. Now I use that quite a bit.

like image 191
Larry Shatzer Avatar answered Oct 29 '22 11:10

Larry Shatzer