PN Tips

Now that the latest release of PN 2 is out, a couple of tips:

Find in Files You can now use find in files to search the contents of files. You need to specify file types to look in, and you can look in multiple types of file at the same time:

File types: .cpp File types: *.cpp;.h

The second example above will search in .cpp and .h files. The Find where box currently requires you to type in a directory path to search. It does, however, support auto-complete so it should help you to find the correct path.

You don’t need to wait for a Find in Files to complete to re-start with a different search, just open up the dialog (Ctrl+Shift+F) and hit Find Next again (yes, the name of that button should be changed in Find in Files mode!).

The find dialog now has a bar along the top allowing you to switch between Find, Replace and Find in Files.

Properties Dialog When you are editing a file you can bring up the properties dialog by pressing Alt+Enter. The active control when you show this dialog is the scheme chooser, so you can choose a different scheme by pressing the first letter of the scheme you are after.

File Properties Dialog

So if you load an XML document with an unusual file extension and it’s not instantly recognised by PN as XML, you can press Alt+Enter, X, Enter to select the XML scheme. To choose perl, use Alt+Enter, P, P, Enter.

Text Clips This version of PN 2 ships with a new set of simple text clips for NAnt scripts. NAnt is a very powerful build management tool that I use, amongst other things, to manage the build and release of PN 2.

NAnt Text Clips

Text Clips definition files use a simple XML format and are stored in the PN2\Clips directory. They are simple to edit and can be extremely useful. If you have created text clips that you feel may be of interest to others please send them to ss at pnotepad dot org. At some point I will create a simple GUI for editing text clips, but this isn’t high on my priority list because they’re fairly simple to edit by hand.

Copy as RTF

Ever wondered what Copy as RTF does? Rich Text Format is an encoding for formatted text that is used by many tools and applications such as Microsoft Office and Word Pad. By copying text in this format, you can paste it into Word or Outlook with the source code formatting applied by PN intact. This is very useful for writing documents about code!