Notepad++ is an open-source text editor for Windows. It is written on Scintila and is a favourite among many programmers around the world. Among its numerous features, here are a few:

  • Lightweight. 6.6 mb after installation.
  • User-defined syntax highlighting.
  • Auto-completion of functions.
  • Regular expression search.
  • Brace and Indent guideline Highlighting.
  • Record and use macros.
  • Plugins
  • A strong and powerful API that helps extending the application easier.
If you have been using Notepad++, you must have felt its great skill at  doing seemingly complicated text-editing tasks. Personally, I like the regular expression search. I saved my ass many times! ;)

Use As Many Macro As Possible

One of the best features of Notepad++ is its ability to record and use macros. If you do a lot of repetitive tasks, just record a macro for each such task.

Comment Chunks Of Code, Quickly

Since I work with a lot of HTML and PHP, often I have to comment chunks of code — both HTML comment and PHP script comments. So I made a two Autohotkey code snippets that makes commenting a snap. Just create a new Autohotkey script and put the following code in it.
; hit CTRL+SHIFT+/ to comment (/* */)
$^+/::
SetTitleMatchMode 2
IfWinNotActive, Notepad++
Return
C_ClipboardPrev = %clipboard% ; get the texts in the clipboard. this will be restored later 
clipboard = ; empty clipboard
Send, ^c
ClipWait, 0.1
clipboard = `/`* %clipboard% `*`/ ; put the formatted comment in the clipboard
Send, ^v
clipboard = %C_ClipboardPrev% ; restore the previous text to the clipboard
ClipWait, 0.2
Return

; hit CTRL+SHIFT+! to comment ()
$^+!::
SetTitleMatchMode 2
IfWinNotActive, Notepad++
Return
ClipboardPrev = %clipboard% ; get the text in the clipboard. this will be restored later 
clipboard = ; empty clipboard
Send, ^c
ClipWait, 0.1
clipboard = `<`!`-`- %clipboard% `-`-`> ; put the formatted comment in the clipboard
Send, ^v
clipboard = %ClipboardPrev% ; restore the previous text to the clipboard
/*ClipWait, 0.2*/
Return
Now, run it. (In case you have no idea about AutoHotkey, here's an exciting post in LifeHacker.) If you want to comment a block of code with HTML comment, just select the text and hit CTRL+SHIFT+! and voila! If you want script comments (i.e. /* Comment here */), just select the text and hit CTRL+SHIFT+/

Add <br/> Quickly



Create an autohotkey script and put the following code in it.
RControl & Enter::
Send, <br/>
Return
After you run the script, just hit CTRL+ENTER to create <br/>

Associate Different File Types For Syntax Highlighting

Some filetypes like .inc and .ctp files are not php files but these files do contain php scipts. By default syntax highlighting is not enabled for these filetypes. Enable syntax highlighting on these filetypes, go to Settings » Styler Configurator... In the next dialog-box, just enter the extra extensions in the "User ext" field. [See the screenshot]

Autoclose HTML/XML Tags

This is an in-built feature of Notepad++ which comes handy if you're working with HTML or XML files. Just go to Plugin » TextFX &rauo; Autoclose XML/HTML tags and done! It's a Dreamweaver-like feature that closes every HTML tag as you type.

Plugins

Notepad++ comes with some preinstalled plugins. Here's a HOWTO on plugin installation. Here are a few plugins which do various tasks with ease.
  • Explorer Plugin: A plugin to browse your drives right from NPP. A light version is also available with a few less features.
  • Colour Picker: Very useful for web-designers.
  • HTML Tag: Creates shortcuts for HTML tags. Like CTRL+B for bold and so on.
  • NppExport: WYSIWYG editor.
  • MultiClipboard: An awesome plugin that creates 10 text buffers. That means your clipboard contains more than one text. CTRL+SHIFT+V pops up a menu containing last 10 texts in your clipboard. All you have to do is to select the one you want. Quickphrase does the same job.

What are your tips?

Labels:

blog comments powered by Disqus