[ Start > PikeTools > TextMate ] [ Edit this Page | Show Page Versions | Show Formatted ]

The TextMate bundle for Pike is a work in progress by Bill Welliver. It's already quite useful, and has the following features:

- code folding (TextMate folding is based on a combination of delimiters and indentation, so you have to be fairly consistent about your indentation within a code block.)
- syntax hilighting
- run pike on a file (__Command-Shift-R__) 
- hilfe (__Command-Shift-H__) 
- code comment/uncomment (__Command-Shift-C/U__) 
- modref lookup (hit __F3__ with insertion point in symbol to lookup) 
- auto class generate (type "__class\__") 
- auto method generate (type "__meth\__") 
- code browsing (function/class) support

__Bundle Installation__

1. Install TextMate from http://www.macromates.com/
1. Download the Pike Bundle from http://hww3.riverweb.com/dist/Pike_TextMate.tar.gz
1. Unzip/untar downloaded file
1. Double click on Pike.tmbundle and allow TextMate to install the bundle.

__Codebrowser Support__

A plugin is available for TextMate that uses ctags to generate a "function directory" for any file you open. ctags can be configured with a set of regexps that define Pike function and class definitions, so that you can have a class browser that works with your Pike files. 

\1. Download and install the TmCodeBrowser plugin from http://www.cocoabits.com/TmCodeBrowser/

\2. Create the file  ~/.ctags.tmcodebrowser (ie in your home directory), and put the following code in it (choose "Show Raw Source" above first):

--regex-Pike=/[ \t]*((public|inline|final|static|protected|local|optional|private|nomask|variant)[ \t]{1,})*(class)[ \t]{1,}([a-zA-Z_][a-zA-Z_0-9]*)/\4/Class/
--regex-Pike=/[ \t]*(((mixed|float|int|program|string|function|function\(.*\)|array|array\(.*\)|mapping|mapping\(.*\)|multiset|multiset\(.*\)|object|object\(.*\)|void|constant|class)|([A-Z][a-zA-Z_0-9]*)){1,}[ \t]{1,}(([_a-zA-Z][_a-zA-Z0-9]*)|`?(!=|->=?|<[<=]|==|>[=>]|\[\]=?|\(\)|[%--!^&+*<>|~\/])))[ \t]*\(/\1/Function/
--regex-Pike=/#[ \t]*define[ \t]+([_a-zA-Z]+)\(?/\1/Define/


\3. Restart TextMate

Powered by PikeWiki2

gotpike.org | Copyright © 2004 - 2009 | Pike is a trademark of Department of Computer and Information Science, Linköping University