PHP and the Future of Text Editors
Vasile Caraus last edited by
the reality is that the future of text editors will integrate PHP into editor scripts. In fact, “sublime text” and “UltraEdit” editors already works on this project, and are very close to develop a new kind of editor.
I believe one of the secret will be an PHP Server on the background of Notepad (somehow like an “Easy PHP dev-server”) and a PLUGIN FORM (run by Regex scripts also in the background) that will resolve many problems, like Increment, inserting something at the beginning or at the end of document, replace only words which are followed by numbers, insert between some words etc.
Anyway, PHP and Text Editor will be fantastic, someday will integrate all the
web programming languages to run the scripts. And trust me, this is the future of text editors.
David Bailey last edited by
An alternative - available now - is to write a plugin for personal use. I have done this (in additional to my one publicly available plugin), and it really is the solution to automating whatever special tasks you need.
Plugins are most naturally written in C/C++.
I think it is possible to write plugins in other languages (maybe even PHP?) but realistically, it is probably simpler to use the same language as is used to implement NP++ itself.
PeterJones last edited by
On my first reading, I was not quite clear whether @Vasile-Caraus wanted PHP to automate Notepad++ (be able to edit text or manipulate the NPP/Scintilla internals using PHP), or wanted to be able to debug some other PHP using NPP as an IDE.
If you want to automate / control Notepad++ using PHP: similar plugins already exist for other scripting languages: PythonScript using Python, and LuaScript to allow you to control/automate with Lua. I would love one for Perl, too, if we’re making statements of desire; but I don’t (yet) have the perlguts skills, nor the NPP Plugin skills, necessary, nor (currently) the time to play around in that regard. But someone with the necessary skills should be able to study the PythonScript and LuaScript plugins and make something similar for PHP (or Perl, hint, hint, hint :-) )
If you want to use Notepad++ as an IDE (integrated debugging environment) to step through PHP scripts, that’s even easier: go grab the DBGP plugin from the sourceforge site or thru the Plugin Manager – it’s been around for a long time – and the XDebug debugging engine. (In fact, I’ve followed some wonderful instructions in order to use that DBGP Plugin with the Perl debugger to make Notepad++ a Perl IDE – so the DBGP Plugin itself is quite versatile).
If you want to use PHP as the language in which to write a full-blown plugin… um, I cannot even give a hint as to where to begin there, sorry. :-)
Jim Dailey last edited by
Also, you can use the NppExec plugin along with your favorite scripting language (AWK, PERL, Python, PHP, etc.) to add extended capabilities to NPP. It takes a bit of work to set it up, but once you do, it opens a lot of doors.
On my context menu I have a Comment submenu that has various forms of comments I can select. They are either applied to the highlighted lines or to the entire file (when nothing is highlighted). To do this I use a combination of NPP Exec and AWK scripts.
I also created the ability to change either ALL or only LEADING tabs into the appropriate number of spaces for the type of file, trim trailing white space, and convert the current “word” into a global variable format I use in the same general manner (NPP Exec and AWK). All these functions work on either the highlighted or all of lines of the file.