TextMate

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


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 in it:

--langdef=pike
--langmap=pike:.pike.pmod
--regex-pike=/[&#116;]*&#40;&#60;&#40;public&#124;inline&#124;final&#124;static&#124;protected&#124;local&#124;optional&#124;private&#124;nomask&#124;variant&#41;&#62;[&#116;]&#123;1,&#125;&#41;*&#40;&#60;class&#62;&#41;[&#116;]&#123;1,&#125;&#60;&#40;[a-zA-Z?-?_][a-zA-Z?-?_0-9]*&#41;&#62;/&#52;/
--regex-pike=/[&#116;]*&#40;&#60;&#40;mixed&#124;float&#124;int&#124;program&#124;string&#124;function&#124;function(.*)&#124;array&#124;array(.*)&#124;mapping&#124;mapping(.*)&#124;multiset&#124;multiset(.*)&#124;object&#124;object(.*)&#124;void&#124;constant&#124;class&#41;&#62;)*&#124;&#60;&#40;[A-Z?-??-?][a-zA-Z?-?_0-9]*&#41;&#62;&#41;[&#116;]&#123;1,&#125;&#40;&#60;&#40;[_a-zA-Z?-?][_a-zA-Z?-?0-9]*&#41;&#62;&#124;``?&#40;!=&#124;->=?&#124;<[<=]&#124;==&#124;>[=>]&#124;&#91;&#93;=?&#124;()&#124;[%-!^&+*<>|~&#47;]&#41;&#41;[&#116;]*(/&#52;/
--regex-pike=/#[ &#116;]*define[ &#116;]+&#40;[_a-zA-Z]+&#41;(?/&#49;/

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