Sharing: Context sensitive help for PHP using Firefox
Submitted by Monday, 19 April, 2010 - 05:20
on
Her's a macro I adapted for opening php.net's documentation in Firefox for the currently selected keyword:
// Context-sensitive help for PHP. String editMode = buffer.getMode().toString(); ffpath = new StringBuffer(); ffpath.append("c:/Program Files (x86)/Mozilla Firefox 3.6 Beta 5/firefox.exe "); keyword = textArea.getSelectedText(); if ((keyword == null) || (keyword.length() == 0)) { textArea.selectWord(); keyword = textArea.getSelectedText(); } if ((keyword != null) && (keyword.length() > 0)) { if (editMode.equals("php")) { keyword = keyword.replace('_', '-'); command = new StringBuffer(); command.append(ffpath); command.append("http://php.net/manual/en/function."); command.append(keyword); command.append(".php"); Runtime.getRuntime().exec(command.toString()); } }