Archive for the ‘netbeans’ Category

tips for php coding in netbeans

30/10/2009

I’ve switched from Vim to netbeans in the past 9 months or so – I’ve been using Vim for 5+ years before that and finding an editor to beat it wasn’t easy. Main aim was to get better code completion, plus whichever editor I used had to have ‘hippie search‘  – this speeds up coding no end. Tried eclipse PDT along the way but found that too slow.

Ultimately netbeans persuaded me to convert. Here are some tips for using it:

General tips

  • Use at least 6.8 beta version of netbeans – there are performance improvements for code completion which increase code completion a lot. If you’ve tried 6.7/6.5 – try again with the 6.8 beta+, especially with large projects.
  • Enable hippie search – The default keys are ctrl+k and ctrl+shift+k – If you’re a Vim person, change these to ctrl+p and ctrl+n. The ‘Actions’ in the keymap editor are ‘Next matching word’ and ‘Previous matching word’
  • Initiate code completion manually – use ctrl+space (default) I find the auto code completion popup just gets in the way. YMMV.
  • Use Navigate menu – this allows you to find files/classes/functions/methods in your code almost instantly
  • phpdoc your code: this allows code completion to work in places it otherwise could not

Symfony

  • Ignore ‘test’ directories – make sure you ignore certain dirs in symfony. This makes code completion ignore classes under those directories.  I have problems with it picking up classes not in our project e.g. sfContext can get confused with sfContextMock from the tests.
  • Symfony is supported in netbeans 6.8M2+ see http://blogs.sun.com/netbeansphp/entry/initial_symfony_support
Advertisements

netbeans php code completion speed

22/10/2009

If you’ve suffered slow netbeans code completion speeds in the past, you should look at the latest dev build

Code completion is much quicker – instead of the 4-5 seconds it used to take, it’s now almost instant on a large php project with approx. 12,000 files (including symfony framework)