TextMate

[ Start > PikeTools > TextMate ] [ Edit this Page | Viewing Version 7 ]


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<tab>")
  • auto method generate (type "meth<tab>")
  • code browsing (function/class) support
Bundle Installation
  1. Install TextMate from http://www.macromates.com/
  2. Download the Pike Bundle from http://hww3.riverweb.com/dist/Pike_TextMate.tar.gz
  3. Unzip/untar downloaded file
  4. 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):

--langdef=Pike
--langmap=Pike:.pike.pmod
--regex-Pike=/[ &#116;]*((public|inline|final|static|protected|local|optional|private|nomask|variant)[ &#116;]{1,})*(class)[ &#116;]{1,}([a-zA-Z_][a-zA-Z_0-9]*)/&#52;/Class/
--regex-Pike=/[ &#116;]*(((mixed|float|int|program|string|function|function&#40;.*&#41;|array|array&#40;.*&#41;|mapping|mapping&#40;.*&#41;|multiset|multiset&#40;.*&#41;|object|object&#40;.*&#41;|void|constant|class)|([A-Z][a-zA-Z_0-9]*)){1,}[ &#116;]{1,}(([_a-zA-Z][_a-zA-Z0-9]*)|`?(!=|->=?|<[<=]|==|>[=>]|&#91;&#93;=?|&#40;&#41;|[%--!^&+*<>|~&#47;])))[ &#116;]*&#40;/&#49;/Function/
--regex-Pike=/#[ &#116;]*define[ &#116;]+([_a-zA-Z]+)&#40;?/&#49;/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