Texpad offers powerful ways of searching within your projects. Along with the standard OS X in-file find and replace, Texpad provides two ways of searching your documents. Global search allows you to find and replace across all files in the current project and a convenient jump-to panel that allows you quickly get to various points of interest in your code.
Global search allows you search all documents in a workspace simultaneously.
Press Cmd-Shift-F or click in the search box on the toolbar to start a search. Once you have typed more than 2 characters of your search term, the search will start and a popover will appear with results as they are found. For a large document, this may take some time, especially when performing regex searches, and the results will be added as they are found.
Some users may be familiar with Regular Expressions, often referred to as regexes. This is a special syntax for constructing complex text searches. This is not an introduction to Regular expressions, the Wikipedia page is a good place to start.
If you want to search by Regular Expression in Texpad, for example, the regular expression string\s+theory
, type it into the search box enclosed in forward slashes, ie /string\s+theory/
. Please note that applying complex regular expressions to a large document can take some time to return all results.
NB Texpad’s Regular Expression engine is based on icucore
, so it uses classical Unix syntax for Regular Expressions.
Once your results are displayed, you may want to replace some of them. To do this, type some replacement text in the box at the bottom of the search popover.
Select a result and press the Replace
button to replace just that search result.
Press Replace All
to replace all search results.
Please note that before any result is replaced, it will be compared to the original search term. It will only be replaced if it matches the original search term.
A useful feature of regular expressions is to capture groups. For example the regular expression /how (\w+) you/
applied to how are you
would capture are
as group 1.
When replacing regex searches, you can insert group 1,2,3, etc. into the replacement string with $1
, $2
, $3
, etc. So if you were to search for /how (\w+) you/
and replace with where $1 you?
, then how are you
would become where are you?
, how were you
would become where were you?
and so on.
The search window is designed to be fully navigable via the keyboard.
The Jump to window will search all symbols in your document in a tolerant manner to help you navigate quickly to figures, files, citations, section titles and more.
Press Cmd-Shift-O to bring up the Jump To window. Type in the name of a section, a filename, a citation key, label key, or even a line number and the jump to window will display any partial or whole matches for that key. Click on the result to jump to it, or press Escape to leave the Jump To window.
The jump to window is designed to be fully navigable via the keyboard, in fact it is designed primarily with the keyboard in mind.