Tools

From MyGamingTalk
Revision as of 19:31, 16 February 2023 by Palota (talk | contribs) (→‎Notepad++)
Jump to navigation Jump to search


Notepad++

Notepad++ is a useful and highly configurable text editor that can be used for editing Omni-bot scripts. It is primarily developed by Don Ho and distributed under the GPL. In July 2009, it was voted "Best Tool or Utility for Developers" by the SourceForge community. In February 2010 it became the SourceForge Project of the Month. Like SciTE and Programmer's Notepad, it uses the Scintilla editing component.

Features

Notepad++.png

The version of Notepad++ available here comes preconfigured with syntax highlighting for GameMonkey script, as well as keywords and auto completion data for Omni-bot. Select Omni-bot from the languages menu.

The archive contains a gmcompiler binary for Windows. Select gmcompiler from the Run menu or press Ctrl+F9. If there are syntax errors in your file, you will see an error message. A double-click on the bold red line in the console window will set the cursor to the line where the error was detected.

To provide an even more IDE-like experience, a help file based on selected Wiki pages is included (Ctrl+F1). The Alt+F1 shortcut searches this Wiki for the selected text.

Note that this version is portable and can be used alongside another installation of the same program. It requires write access to the installation folder and some of the subfolders.

Download

Additional plug-ins can be downloaded from SourceForge.

Recommended fonts: Consolas, DejaVu Sans Mono.

Useful Keyboard Shortcuts

Ctrl+Tab: Cycle through file tabs
Ctrl+F4: Close current file tab

Ctrl+C: Copy
Ctrl+Shift+C: Append selection to clipboard (append-copy)
Ctrl+X: Cut
Ctrl+Shift+X: Append selection to clipboard & delete (append-cut)
Ctrl+Shift+V: Extended clipboard (plugin)
Ctrl+Down: Move current line down
Ctrl+Up: Move current line up
Ctrl+D: Duplicate current line/selection
Ctrl+L: Copy current line
Ctrl+Shift+L: Cut current line
Ctrl+Q: Comment/uncomment selected lines (toggle)
Ctrl+K: Comment selected lines
Ctrl+Shift+K: Uncomment selected lines
Alt+I: Indent selected lines and surround with curly braces
Ctrl+T: Trim trailing whitespace
Alt+Shift+S: Trim trailing whitespace and save (macro)

Ctrl+J: Word completion
Ctrl+B: Jump to matching brace
Ctrl+Shift+B: Select to matching brace
Alt+Shift+B: Select lines to matching brace
Ctrl+Shift+Up: Mark current word or find backward
Ctrl+Shift+Down: Mark current word or find forward
Ctrl+M: Highlight all occurrences of current word
Ctrl+Shift+M: Remove highlighting
Ctrl+F2: Set/unset bookmark (same as left-click on margin)
F2: Go to next bookmark
Shift+F2: Go to previous bookmark

Ctrl+F9: Send current file to gmcompiler.exe
Alt+F1: Search for current word in Omni-bot Wiki
Ctrl+F1: Search for current word in Omni-bot.chm

QuickText
In addition to keyboard shortcuts in the usual sense, a lot of abbreviations are configured in the file QuickText.ini (included in the download). Substitution of the abbreviations is triggered by the shortcut Ctrl+Enter. (If Ctrl+Enter doesn't work for you, there is most likely a shortcut conflict. Resolve it via Settings -> Shortcut Mapper.)

Refer to section [15] of the QuickText.ini file for a list of preconfigured abbreviations.
Example: Type "ie" and press Ctrl+Enter three times.

History

June 6 2011

Upgraded to Notepad++ 5.9.2 (Unicode). See change.log and readme.txt for more information.

November 27 2010

Upgraded to Notepad++ 5.8.5 (Unicode).

June 28 2010

Portable distribution of Notepad++ version 5.6.8 (Unicode) with some customizations, including syntax highlighting and auto-completion for Omni-bot 0.8. See included omni-bot.txt for more information. Tested under MS Windows 7, Vista and XP.

December 5 2009

Upgraded to N++ 5.6.1 (mainstream Unicode branch). Improved function list behavior, among other things.

September 21 2009

Upgraded to N++ 5.5 (ANSI version). See change.log for new features.

April 24 2009

Upgraded to N++ 5.3.1 (ANSI version). Upgraded NppExec plug-in to v. 0.3 (now includes a help file), added some syntax highlighting and folding for .script files.

February 18 2009

Upgraded to N++ 5.2 (ANSI version).

January 26 2009

Upgraded to N++ 5.1.4 (ANSI version). Added N++ help file, updated plug-ins.

January 7 2009

Upgraded to N++ 5.1.3 (ANSI version).

December 4 2008

Added some shortcuts, QuickText.ini and Omni-bot.chm (Ctrl+F1).

November 12 2008

Upgraded to N++ 5.1.1.

October 24 2008

Upgraded some of the plug-ins to newer versions, removed XML Tools plug-in due to a dependency on an uncommon external library (and bad error handling).

October 17 2008

Upgraded to N++ 5.0.3, updated auto-completion file.

August 1 2008

Upgraded to N++ 5.0.2.

July 19 2008

Upgraded to N++ 5.0.1.

July 6 2008

Upgraded to N++ 5.0.

March 12 2008

Updated function list expressions and Notepad++ executable.

March 2 2008

Initial upload of Notepad++ for Omni-bot. Contains most autocomplete and highlighting for Enemy Territory and core Omni-bot.

SciTE

  • SciTE is a useful and extendable text editor of choice for the Omni-bot developers.

The version of SciTE available here comes pre-configured with syntax highlighting for Game Monkey script, as well as keywords and auto completion rules for Omni-bot.

Wscite.jpg


Feb 9 2008

Initial upload of SciTE for Omni-bot. Contains Most autocomplete and highlighting for Enemy Territory and core Omni-bot.


PSPad

PSPad is a useful and extensible text editor of choice for the Omni-bot developers. It can be easily set up to work with many different programming and markup languages. Get the syntax highlighter archive below and copy the subfolders of the archive to your PSPad folder for a quick start.

Basic Setup

Which files go where?

Get the syntax highlighter zip archive below and copy the folders contained in the archive to your PSPad folder, or extract the archive and copy the files you want one by one.

The archive contains:

  • An .ini file that list all the GameMonkey keywords, as well as most Omni-bot constants and functions; this belongs in your PSPad\Syntax folder.
  • A .def file that provides code snippets and some syntax hints; this belongs in your PSPad\Context folder.
  • A template for map scripts in standard format, a template for weapon scripts, and one for bot scripts; these should go to your PSPad\Template folder. Most users will hardly ever use them, but some might find them useful. Note that you can have any number of templates for a given file type.
  • A script that can help to properly indent your code. It is intended for use with JavaScript code, but due to the similarity of the syntax, it can be used with GM files too. Useful if you have a piece of code whose indentation got messed up somehow, e.g. through copy and paste.

Setting up the Code Explorer

Unlike SciTE, PSPad has no code folding (i.e. no plus or minus signs on the left that can be used to collapse or expand blocks of code). This is partly compensated for by the code explorer, a dockable window that shows the functions defined in your code. If the code explorer doesn't work in your setup, choose ftGM as code explorer file type:

PSPad Screenshot

Using an interpreter or compiler to find syntax errors

Ideally, you should get the SciTE Editor pack and use gmcompiler.exe as compiler for .gm files, or get the GameMonkey download and use the gme.exe contained therein. This will help to find syntax errors.

PSPad Screenshot

Using PSPad with Omni-bot scripts

PSPad Screenshot

Code Completion: Turbo-charge your work

Most IDEs have a feature that is most commonly known by the Microsoft trademark IntelliSense. As a generic editor, PSPad can't have all the benefits of a dedicated IDE with IntelliSense, but it has two similar features: Clips or snippets and Auto Completion, by default invoked via Ctrl+Space and Ctrl+J, respectively. The pop-ups are never triggered automatically in PSPad, you have to use the keyboard shortcuts mentioned above.

  • The clip window (Ctrl+Space) shows everything that is configured in the omni-bot.def context file. You can type while it is open in order to narrow down the list.
  • The auto completion window (Ctrl+J) scans
    - your currently edited file,
    - the syntax definition omni-bot.ini
    for entries that match the characters left of the cursor. This is useful for variable names and keywords that haven't got a clip definition entry.

For example, when you type "voi" into the editor and press Ctrl+Space, you'll see a pop-up similar to the following: PSPad Screenshot

Downloads

For more info on how to use the highlighters see the ReadMe.txt within the zip archives.


Page History

Feb 14 2008

Initial upload of PSPad highlighting for Omni-bot. Contains most autocomplete and highlighting for Enemy Territory and core Omni-bot.

Feb 15 2008

Minor improvements and corrections. -- d00d 06:49, 15 February 2008 (MST)

Feb 27 2008

Minor improvements, both to the DEF file and the indentation script. -- d00d 05:05, 27 February 2008 (MST)

Oct 29 2008

Updated some of the code hints etc. for 0.71. --d00d 21:51, 29 October 2008 (UTC)

Dec 12 2010

Added link to 0.8 highlighter. --d00d 10:19, 12 December 2010 (UTC)

Programmers Notepad

Programmer's Notepad is a very useful text editor based on the Scintilla open source editing component. It is developed by Simon Steele.

Features

Prog np.jpg

The version of Programmer's Notepad available here comes pre-configured with syntax highlighting for GameMonkey script, as well as keywords and auto-completion data for Omni-bot 0.81. Select Omni-bot from the Schemes menu. As you can see in the above screenshot, code folding is enabled, and a basic function list based on Exuberant Ctags is integrated.

The archive contains a gmcompiler binary for Windows. Select gmcompiler from the Tools menu or press Ctrl+F9. If there are syntax errors in your file, you will see an error message in the output window at the bottom of the screen.

This version (2.2) is fully portable and won't overwrite any of your settings if you have an existing installation of Programmer's Notepad. See below for downsides this might have.

Downloads

Download Programmer's Notepad (this is all a typical user will need).

Auto-indentation script, requires PyPN and a working Python installation. It indents your code as you type, according to your tab settings. The following code was typed without any manual changes to the indentation:

Indent.jpg

Syntax highlighters only (not recommended for most users). This archive contains a .scheme and a .schemedef file that both work with Programmer's Notepad 2.0.8 (build 718). Use only one of these files at a time, and be sure to delete the ob.cscheme file in between when experimenting!

Known Limitations/Problems

  • Since the syntax definition uses the built-in C++ lexer, the number of keyword categories is limited to 2.
  • This version is fully portable and stores all settings in its own folder. Hence write access to the folder where the program is installed is required, which may cause problems if you are not logged in as Administrator. Solution: Install to a folder to which you have write access.
  • The subfolder Microsoft.VC90.CRT contains very common runtime libraries that are useless for those users who have them installed already. Try deleting the folder.

History

October 23 2008

Initial upload of Programmer's Notepad (portable version) for Omni-bot. Includes syntax highlighting, code folding, code completion, ctags support.

October 30 2008

Improved ctags support, added runtime libraries.

June 13 2011

Updates: PN 2.2, OB 0.81.


<headertabs />