notepad++

The latest release of Notepad++, a Windows OS based open source text editor, supports Tcl syntax highlighting. It can be downloaded at the following web address:

http://sourceforge.net/projects/notepad-plus

JMN 2005-11-29 This seems like a fairly nice usable editor.. but the Tcl syntax highlighting is not quite there yet.

Some issues I've noticed:

problem 1) If a tcl comment line contains 'if' as the first element - notepad++ incorrectly starts a new nesting level - putting other sections out of sync.

e.g the following line is mishandled.

 # if blah blah blah

problem 2) Escaped brackets aren't matched properly.

e.g the following sorts of lines are mishandled (incorrect bracket-match highlighting)

 set x {abc\{d}
 set y [list a b\[c d]
 set z [list a {b[c} d]

JMN 2009-05-14 version 5.3.1 (Mar 29 2009) still has the above problems. Also - it's really unfortunate that c-style comments are recognized by the highlighter even when editing Tcl files. the sequence /* is very common in scripts dealing with the filesystem or with for example, the tdom xml parser.

Entire sections of code end up highlighted green.

As opposed to my 'nice usable editor' comment above.. I'd now say: 'barely tolerable for Tcl work' and the phrase 'supports Tcl syntax highlighting' is extremely optimistic at best.

JMN 2018 Despite a few shortcomings - I just kept coming back to notepad++ and it has improved.

 set z [list a {b[c} d]

still doesn't match brackets perfectly - but it's not a significant problem. The function list feature is great - once you've configured it to your liking. Understanding and configuring the regexes in functionList.xml is pretty tricky (for me) - but with a bit of fiddling you can get it to show TclOO methods/constructors grouped by class. The function list parsing system seems customisable enough to at least give basic navigation for a Domain Specific Language or custom OO system you might have etc. I've had bigger struggles with editors such as Atom, Komodo & Eclipse trying to get them to behave reasonably for Tcl work.


scottdware 2011-04-26 I have been annoyed with the improper syntax highlighting as well (mostly using the if-elseif-else statements), so I created a User Defined Language file that has seemed to have taken care of the syntax highlighting issues. I have tested it out numerous times, and I've tweaked it to include all of the default Tcl and Tk commands, the 8.6 TclOO commands, as well as all of the option modifiers (-glob, -all, -nocase, -padx, etc.) that go with the commands. Here's the link:

tcl-lang.xml

To install it, just do the following:

  1. Place it in the root of your Notepad++ directory.
  2. Open up Notepad++, and click on View->User-Defined Dialogue.
  3. Once the User-Defined Dialogue window pops up, click on "Import...", and browse to the tcl-lang.xml file.
  4. Close Notepad++ and then re-open.

If you aren't seeing the syntax changing, try to select (when you have a .tcl file open) "Language->Tcl" (it should be at the very bottom).

scottdware 2011-04-26 Here's the XML file to place in "<Notepad++ install directory>\plugins\APIs\" for auto-completion of all Tcl and Tk commands. You'll have to enable it under "Settings>Preferences>Backup/Auto-Completion."

tcl.xml


HaO 2011-04-20 One inconvenience is the lack of full utf-8 support to edit message files.


Mho Those who are using Notepad++ should definitely take a look at Notepad2, too. The extended version comes with Tcl highlighting etc.:

This editor is ultra compact (below 400k when compressed with upx), ultra fast, and does not need an installation. 64bit .exe is available, too.


scottdware - 2011-04-22

This modded version of Notepad2 is great. I've tried it before I got hooked on Notepad++. The only thing I have an issue with is how it treats control structures with its syntax highlighting.

It has the same issues that Notepad++ does before I made the custom syntax file. Doesn't really treat if-elseif-else properly. Just my $.02, though (I'm just kind of picky when it comes to that) :)


Lectus - 2011-04-21 14:31:32

Thanks for pointing out Notepad2. This gave me an idea of setting up a portable Tcl/Tk development environment for pendrives.

This is the resulting directory structure inside the pendrive:

tclkitsh-8.5.9-linux-ix86 --- Linux tclkit without Tk

tclkit-8.5.9-linux-ix86 --- Linux tclkit with Tk

tclkitsh-8.5.8-win32.upx.exe --- Windows tclkit without Tk

tclkit-8.5.8-win32.upx.exe --- Windows tclkit with Tk

sdx.kit --- For creating starkits and starpacks for both Windows and Linux

sqlite3.exe --- For managing databases

tclsqlite3.dll --- Tcl sqlite DLL for creating DB apps

upx.exe --- For compressing starpacks

tkchat.exe --- For chatting and getting help

lib --- Precompiled libraries for using in apps that use extensions

Notepad2.exe --- For editing

Notepad2.ini --- Editor config file

doc --- Packages documentation

This gives flexibility to develop anywhere and also deploy for Windows and Linux machines. It only shows how awesome Tcl are compared to other scripting solutions.


tarzan - 2017-05-18 09:06:50

Tcl FunctionList @functionList.xml

@associationMap

<association id="tcl_procedure" langID="29" />

@parsers

<parser id="tcl_procedure" displayName="TCL" commentExpr="(#)">
    <function mainExpr="^[\t ]*((proc)[\s]+)[^\n]+\{">
        <functionName>
            <nameExpr expr="(proc)\s+[\x21-\x7E]+" />
            <nameExpr expr="\s+[^\s]+" />
        </functionName>
    </function>
</parser>

rule of proc any graph string? or any string except space?



Siqsuruq - 2022-07-13 23:20:28

My Tcl Notepad++ Syntax Highlighting xml GitHub