Open main menu

Notepad++ (Npp), like Scite, is based on Scintilla. It is a programmer's editor, but for a non-programmer user it is amazingly easy to configure. Like Scite, it has global utf-8 support (as opposed to local utf-8 support which Scintilla does not support).

For Windows users (you can also use it under Wine) wanting a more modern interface with loads of included features (see especially the TextFX menu), it deserves a close look. One nice feature is that from any text selection (such as a control sequence) you may do a ConTeXt Wiki search from the RUN menu or [ALT-F2]. In addition there is Google and Wikipedia search. There is also a wonderful Explorer plugin.

Most of the Scite ConTeXt commands are included (same shortcuts), in both RUN and script versions (for the console F6).

Npp is just loaded with features and supports plugins. For more information about Npp go to http://notepad-plus.sourceforge.net/uk/site.htm

ConTeXt implementation

For ConTeXt, the following features have been implemented:

Syntax highlighting

There are various kinds:

  • \start-stops
  • TeX primitives
  • setups
  • comments
  • sectioning
  • general ConTeXt commands
  • operator arguments
  • numbers

Folding

Folding can dramatically increase efficiency in writing long documents. All \start-stops are foldable, and you can easily add your own in the User-Defined-Language dialog; just select "ConTeXt" and you can edit all entries.

The t-startstops module (provided by Wolfgang Schuster) converts section headings like \chapter into \startchapter-\stopchapter, etc. You can add more. Look at the files t-startstop.tex and startstop.tex.

NOTE: Hans will eventually implement official support for startstops, and the syntax will in all likelihood be different from the one used here (\startpart[title=,ref=]).

Auto completion

There is a Notepad++ api file context.api, which has a list of perhaps all english ConTeXt commands. From the Scite properties files you can find more keywords for your your own language and roll your own version. The nice thing is that Npp has a sorting utility so you can easily add your keywords and alphabetically sort them into your own api list.

ConTeXt utilities

RUN menu

The Run menu mimics the one in Hans's distribution of Scite, and mostly uses the same shortcuts. You can add more by pressing [F5] and saving your command, which will allow you to define a shortcut.

A few utilities, which come with the default Npp setup but which do not seem relevant to ConTeXt, have been deleted. If you want them back just look at the original shortcuts.xml file and copy the ones you want.

A few nice tricks are there. For example,

\input file.tex

After selecting "file.tex" you can run "open file" and Npp will open file.tex for you. From selected text, you can also do a Google search, wiki search. Perhaps we could add a ConTeXt wiki search.... next version perhaps.

NppExec

Npp comes with a Console plugin, NppExec, which allows you to run scripts. Most of the Run commands have been implemented as scripts in NppExec. Here you can play around with the commands, test different options etc.

Integrated Explorer plugin

This is one of Npp's most useful tools. Some TeX-related filters have been added.

Both NppExec and the Explorer are dockable. They can also be docked into one another outside of the main editor, separately outside, or separately inside. You'll have lots of fun with these two.

Colour

The implemented colour theme is easier on the eyes than the default pure white background. It makes use of four shades of DADADA. For non-TeX languages you may need to tweak the settings a bit in Settings > Styler Configurator.

Languages

Most of the languages have been removed from the Language menu, but you can bring back any language you need from Settings > Preferences > Language Menu.

Shortcut Mapper

The shortcut mapper has been slightly changed: [Ctrl-Shift-Z] does undo now. shortcut.xml controls this.

New functions

Four functions have been added to the ConTeXt menu (right-click that is):

  • Split lines
  • Join Lines,
  • Text Direction RTL
  • Text Direction LTR


Notes

Nearly everything above is easily configurable. I could not implement support for non-startstop folding with sectioning like \chapter etc. because that would mean compiling the scintilla lexer, something I'm not interested in doing. If anyone knows how to do lexer programming and is interested, feel free;-)

This package depends on Npp 4.2, so if you already have Npp then upgrade to the latest version.

The documentation.bat file is based on code from Adrian Drury. Eventually it may be replaced with the mtxrun utility.

Installation

ConTeXt Support Package for Notepad++.

This package is for Notepad 4.2, released August 12 2007, or later. The file config.xml in particular may not work with other versions, especially if you start it with the batch file.

Instructions:

  • Download the installation files from the Notepad++ web-site.

From the installer, you MAY not want to use the default destination folder, 'Notepad++'. texexec and company choke on directory names with characters like '+' in them. So you could change it to, eg, 'Notepadpp'. So if you plan on linking the ConTeXt utilities with the notepad installation directory somehow then you may want to change its name.

In the following it is assumed that the installation directory name remains 'Notepad++'

You may also want to check the installation option, "Don't use %APPDATA%". Then all your configuration settings will be saved in the installation directory. This is because, even if you rename the installation directory, the name of the local user application directory will still be 'Notepad++'.

In the following it is assumed that all configuration files are saved in \<username>\Application Data\Notepad++.

  • You may want to install a few plugins. The installer will give you a list of plugins you can select. Go to the following links for details:

http://notepad-plus.sourceforge.net/uk/plugins-HOWTO.php

The NppExec plugin is required and has been configured for ConTeXt.

In the following it is assumed that you have also installed the Explorer and NppExec plugins.

  • Ensure that Notepad++ is in your path. If not, add C:\Program Files\Notepad++ to your system path in System Properties > Advanced > Environment Variables > System Variables > PATH.
  • In System Properties, make LNK files executable. Go to System Properties > Advanced > Environment Variables > System Variables > PATHEXT. Click on Edit and add ".LNK;"
  • Now log out and log back in (to activate the environment variables).
  • Make sure Notepad++ is closed.
  • There are three zips within the package:

Application Data.zip ConTeXt.zip Program Files.zip

  • Copy the directory Program Files\Notepad++ to Program Files.
  • Copy the directory Application Data\Notepad++ to Application Data.
  • Copy the contents of the directory ConTeXt to your ConTeXt tree.
  • For processing ConTeXt files, always use the batch file npp.bat to open Notepad++. npp.bat is based on cscite.bat. You can change the icon for a shortcut to the batch file by going to the shortcut properties, Change Icon, and point it to Program Files\Notepad++\Notepad++.exe.
  • A note: In Preferences, always leave the option "Remember the last operation directory" unchecked.
  • Edit batch files in the ConTeXt directory to suit your needs. Please forward any major improvements!

Installation problems

Sometimes there are slight problems with the above installation. This section attempts to address them.

Background colour does not change

By default the background colour is set globally for all languages. This means that all other background colour settings are ignored. To alter the colour, or revert to using individually defined background colours, go to "Settings - Style Configurator - Global Styles - Global Override" and either change the colour or untick the box "Enable global background colour".

Acrobat does not open

The default shortcut provided, "Acrobat.lnk", points to the file "Acrobat.exe". If you only have the Acrobat Reader, you need to change this shortcut to point to the file "AcroRd32.exe", which might be found in the folder ""C:\Program Files\Adobe\Reader 8.0\Reader".

 
TODO: still need to add help for problems here (See: To-Do List)


Links

Npp homepage:

ConTeXt package: