Tuesday, September 14, 2010

Add dictionary support to Notepad++

I love Notepad++. It's light-weight, support many languages, has word completion feature and also includes a Spell Checker. So for all practical purposes, it's a functional editor. Having a dictionary support in your editor is always the best thing and it's very simple when it comes to Notepad++. 

It already has a plugin for Spell Checker which you can find under Plugins->Spell Checker ..
All it requires is GNU Aspell and  a dictionary installed on your machine. 
GNU Aspell is a Free and Open Source spell checker. It can either be used as a library or as an independent spell checker. Main features include 
  • possible suggestions for misspelled words 
  • supports UTF-8 document encoding
  • supports multiple dictionaries. 
Enable Spell checker in four easy steps - 
    1. Download and install Aspell for Windows from
    2. Now install a dictionary which you can download from the same website.
    3. Notepad++ requires a relative path for aspell-15.dll. Open Plugins->Spell Checker.. A dialog box will open where you can edit the relative path. I have both Notepad++ and Aspell installed in "C:\Programs Files" so I entered the path as "../Aspell/bin"
    4. Restart Notepad++

Bingo! Now if you open Spell Checker, it will show you the list of misspelled words in the current document and possible suggestions. 

Friday, September 3, 2010

Add git branch to bash prompt

If you use git, you will find this small trick very useful.

To make your bash prompt super spiffy (and equally useful), add this to ~/.bashrc:

 #Adding git branch to command prompt
 gitStatus() { git diff --quiet 2> /dev/null || echo ' *' ; }
 gitBranch() { git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/ > \1$(gitStatus)/" ; }

Then, somewhere in your $PS1, put \$(gitBranch). Here's an example; try it:

      export PS1="[\u@\h$ \w\$(gitBranch)]\$ "

When you're in a git directory, you'll notice the branch name on the prompt. If the branch has been modified, an asterisk will appear next to the name. Here is an example :

My command prompt looks like this - 

cdump@cdump-linux : /workspace/android/platform > cros-wm *$

indicating I am on cros-wm branch and there are modified files.

Credit Serban Giuroiu