Perl Monk, Perl Meditation PerlMonks

### Favorite or most wanted text editor features?

by EvanK (Chaplain)
 on Oct 19, 2001 at 09:48 UTC ( #119888=perlmeditation: print w/ replies, xml ) Need Help??

What are your favorite features of your current editor? and what features would you really LIKE to see implemented? the reason I ask is, i'm making my own text editor (which is going up on sourceforge, btw) and i'm probing for any cool features to (attempt to) implement.

myself, I want to be able to use a find and/or replace feature as a perl regex, ie: searching for <[^>]> would find anything between 2 angle brackets...I also think it would be cool to have a history list, like in photoshop, where you could undo changes for like 20 or 30 steps back...

______________________________________________
RIP
1952 - 2001

Comment on Favorite or most wanted text editor features?
Re: Favorite or most wanted text editor features?
by Chady (Priest) on Oct 19, 2001 at 10:47 UTC
<joke>It should have a Save option.</joke>
He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Just all the vi functions..
Just all the emacs functions..
Syntax Colouring
by claree0 (Hermit) on Oct 19, 2001 at 11:11 UTC
....useful if you're like me and get into an escaping frenzy....and escape your closing brackets on an expression, then at least you can _see_ that you've done it.

This would, however, probably result in your needing a separate profile for each 'supported' language.

Re: Favorite or most wanted text editor features?
by thinker (Parson) on Oct 19, 2001 at 12:51 UTC
Hi EvanK

How about an interpreter for Emacs Lisp (elisp'', for short), a dialect of the Lisp programming language with extensions to support text editing.
Oh, and tetris of course ;-)

cheers

thinker
Don't forget a built in "Towers of Hanoi" -- a classic exponential algorithm (M-x hanoi).

-Blake

And if I'm stuck there should be a friendly doctor helping me out :) (or would I prefer to find some bombs?)

stefan_k

Re: Favorite or most wanted text editor features?
by stefan k (Curate) on Oct 19, 2001 at 12:51 UTC
I once had the same plan and you can see some of the ideas it produced at this page, but I think that it is far too late to catch up with (x)emacs. See e.g. the node I just wrote: Re: Learning Emacs

I still feel it would be cool to have a perl interpreting editor, and I still think I have some pretty design thoughts, plus some real good features, but YATE (yet another text editor) just feels so wrong. For me XEmacs has almost all powers I could imagine - besides that I have to write the defuns in elsip ;-), for others vi(m) is really _it_. Yes and I even know people how feel content with nedit *grin*.

It's just some things missing like different highlighting (and maybe keybindings) in format strings or at other places - usually most of them come down to have several differents modes in one file at different positions, which is a relatively new requirement with PHP and HTMl mixed up (or JSPs or HEREDOCS or...). It will probably be more effective to get those features into existing architectures that starting a whole new editor project.

As for your regexp search: of course emacs can search for regexps, they're just plain ugly - uhm, I wanted to say: not of the elegant perlish style. And you can setup the levels of undo you'd like to have.

 Regards... Stefan you begin bashing the string with a +42 regexp of confusion

mdupont has told me about a version of emacs that understands perl as well as elisp. pmacs maybe is the name? Maybe it uses perl regexen instead of emacs?(Although dont forget that various features of emacs regex engine were quite well rated by Friedl.)

Yves
--

I know of one project which has that aim, but in the past they concentrated on Gnu Emacs. Actually the last thing I read when visiting their website was that they were quite disappointed by the gnu emacs people and were planning to port their efforts to xemacs... I should have a look again...

See them at: perlmacs-home

 Regards... Stefan you begin bashing the string with a +42 regexp of confusion

Have you tried mmm-mode for emacs? I use it with great success to edit HTML::Mason-components (their syntax is very similar to ASP - perl code inside special tags).

According to documentation it works for Mason, Embperl, ePerl, JavaScript and CSS inside HTML, JSP and even Perl here-docs with some heuristic about what submode should be used inside here-doc.

-- brother ab
It is currently in my incoming directory, which means that I know it but haven't introduced it to my xemacs setup, but I'll probably do when I'll need it :)

 Regards... Stefan you begin bashing the string with a +42 regexp of confusion

I still feel it would be cool to have a perl interpreting editor

maybe you should check out vim's perldo =)
Re: Favorite or most wanted text editor features?
by MZSanford (Curate) on Oct 19, 2001 at 13:06 UTC
Well, if this is a text editor for programmers, i would like some of the following :
• Bracket matching
• Color Coding (syntax highlighting, standard to code editors)
• FTP (or SSH) interfaces for editing remote files (like SlickEdit)
• perl -c inteface (via a button named check maybe ?)
• User settable icons (like Dev-C++ (gnome|normal))
• Template facility
• URL Encoding (i hate typeing &lt;)

And, some features i would like in a text editior regardless of if it is a code editor or not.
• Unicode capable
• (En|De)cryption (via pgp or DES maybe ?)
• Perl Regular expressions (as you stated. I would love this)
• vi (or vi like) substitution ability
• <joke> a (hidden?) link to the monastery in the help menu </joke>
• GPL :)

i had a memory leak once, and it ruined my favorite shirt.

XEmacs does most of what you want...

WABOP C-u 1 M-x add-global-abbrev RET with a bit of programming RET

• FTP / SCP interface for editing remotely: FTP is ADBX; I'm not sure about SCP. It shouldn't be too hard to modify ange-ftp though; so SCP can be ADBX WABOP.
• perl -c interface: ADBX IIRC with CPerl mode; if not, easily creatable using shell-command-on-region and save-excursion, so can be ADBX WABOP.
• User settable icons: Doable IINM.
• Template facility: I'm not sure what you mean.
• URL Encoding: I think you mean HTML entity encoding. Just create a new minor mode, say, html-entity-encoded-mode, and add a hook to check for new characters needing entity-encoding. ADBX WABOP.
• Unicode capable: XE is *almost* Unicode capable. People are working on it.
• Cryption: Unfortunately not ADBX, yet, though one can invoke GPG or similar with an (M-x term)-inal.
• Perl 5 regexen: One way to do this is interface to perl itself; another way would be to rewrite XE's regex engine... can be ADBX WABOP or with a lot of programming depending on how you approach it.
• vi (or vi like) substitution ability: Blasphemy! Blasphemy! :-) Really though, (?:query-replace|isearch)(?:-regexp)? is enough for me. I'm not sure how vi handles it.
• Link to the monastery: Can open URLs. Can therefore open http://www.perlmonks.org/, either with XE/W3 or in a separate browser.
• GPL: That it is.
Re: Favorite or most wanted text editor features?
by jynx (Priest) on Oct 19, 2001 at 13:07 UTC

With a grain of salt,

It is worthwhile to note that the things you want in a text editor have probably been thought of before and implemented. To that end, the two most common text editors are:

These are mentioned in alphabetical order (so please nobody start a holy war) and both are widely available for many platforms. There are also an extensive collection of macros and modules for both that alter their behavior to pretty much anything you can conceive of being worthwhile.

i mention these not because you shouldn't try writing your own; i encourage you to do so, you would learn a lot along the way. It's still a good idea to look at these and learn from them before planning your own. If you happen to find exactly what you want (which is always possible) than you can save a lot of work :)

In answer to your questions, my favorite features include being able to undo as much as i want, and being able to shell escape in mid-coding run to check man pages or some such. The only thing i can think of that it doesn't provide is Perl regex, but since i don't do seriously mind-boggling searches through files i don't need the extraordinary power of Perl regex (want, now want is another matter :)

jynx

Re: Favorite or most wanted text editor features?
by nefertari (Chaplain) on Oct 19, 2001 at 13:44 UTC
It should have a kind of hierarchy-test. An ATARI-Editor (Tempus) had this, you could tell him the beginning of a subelement and the end (for perl { and }, for TeX for example \begin and \end), and it would (try to) tell you, where there was a mistake. This is the function i miss most, since i left the ATARI.
Re: Favorite or most wanted text editor features?
by Anonymous Monk on Oct 19, 2001 at 15:49 UTC
-Save to FTP (SFTP) -Print in Color (or save to HTML) -Can't stand editing on the monitor in color, and I can't stand looking at a printout of an algorithm in black ink.
Re: Favorite or most wanted text editor features?
by Caillte (Friar) on Oct 19, 2001 at 15:58 UTC

My favourite editor is vi... mostly because of the keyboard interface. My favourite feature on an editor is the undo button ;)

$japh->{'Caillte'} =$me;

Re: Favorite or most wanted text editor features?
by George_Sherston (Vicar) on Oct 19, 2001 at 16:13 UTC
I use EditPad Classic, which so far I find has the right balance of features to complexity. The whole jgsoft stable might be a source of good ideas if you haven't seen it already. It looks as though you are going to implement some perl-specific features which I didn't know I needed, however, and it makes me think there are a few things that wd be useful. A template, for example, that popped up a blank file with a shebang line, use strict; and whatever else I found I always wanted. And wd it be possible to have a "Save as CHMOD 755" option? And making the tab button insert 4 spaces, rather than a tab, wd be nice... and indeed auto-indenting by n+4 any line following a "{" - where n is the indent of the preceding line... and indeed preserving the indenting from line to line. And how about building the logic of strict into it, so before I save I click on the "check strict" button and it goes through all the violations, highlighting each one for me to edit it?

Well, I applaud your enterprise and generosity, and I'll be very interested to see the result when it's done.

§ George Sherston
Re: Favorite or most wanted text editor features?
by CubicSpline (Friar) on Oct 19, 2001 at 16:39 UTC
While a staunch user of vi when in the Linux side of the force, I've totally fallen in love with TextPad when I'm working in Windows. Some of the features that I find the most useful:
1. Search/Replace capabilities
• Perl-like regex searching
• Bookmarking all matching lines
2. Document Classes for different file extensions
• Color coding for keywords, constants, etc.
• Tabulation and paren/brace autocomplete
3. General Editor features
• Block edit mode (allows you to select text in a block, rather than line by line)
• Ability to view whitespace characters
• Increase/Decrease indentation for select block of text
The only thing that TextPad doesn't have that I want is the ability to execute the perl that i'm editing in a command prompt.
The only thing that TextPad doesn't have that I want is the ability to execute the perl that i'm editing in a command prompt.

Have you looked at the Tools feature? In the Preferences menu, choose Tools and define a new tool thusly:

• Command: C:\Perl\bin\Perl.exe
Parameters: $File Initial Folder:$FileDir
• Check the boxe labelled Capture output
This will run the Perl program and show its output (including any errors) in a new window.

It is then possible to assign this tool to a key (I use CTRL-1) for fastest use.

Re: Favorite or most wanted text editor features?
by jepri (Parson) on Oct 19, 2001 at 16:48 UTC
All the above plus awareness of the perl compiler so it will keep a list of errors and put the cursor on the line with the error. Then a key to run your program in perl.

Just like the QuickBasic IDE.

____________________
Jeremy
I didn't believe in evil until I dated it.

I use JEdit for this, as well as because I work with both Unix and Win32 without having to change editors.

Re: Favorite or most wanted text editor features?
by ajt (Prior) on Oct 19, 2001 at 16:50 UTC
Here is my 2p on the thread...

I use Alan Philip's "Programmer's File Editor", PFE on my Windows boxes. Here are my reasons for using this tool, rather than others.

• I've used it for over 5 years, so I'm familiar with it - though we all claim sound reasons for editor "x" or "y", I think familiarity is a big reason we all stick with our favourites
• It's free, though not open source. I don't have money to splash around, especially when I started to use it
• It's very small, 608kb, so it's easy to move around
• It's got a nice multi-document interface - though it's looking dated now
• It's quite flexible and configurable, has nice simple macros, good search/replace, and was designed to talk to an external compiler and caputure the results
• If you tell it Perl is c, then it does a nice job at auto-indenting your code for you, which is ofcource configurable
• It's very fast to start, and it's easy to live with
• It can save either with *nix or Windows line endings

I'm sure there are other nice things about it, but I think the list is long enough. It's a dead product, but until something better arrives, I'm sticking with it.

I think if I were to want features in a perfect editor, for a casual user like my self, I'd want:

• Small and fast
• I like the idea of syntax highlighting in colour, but I find it irritating over time (I have dyslexia), and don't use much
• Easy interface to the Perl complier
• Plug-in archtecture, HTML-Kit for example allows to you plug in the W3C HTML, XML and CSS specs, so you can have context sensitive help directly from the source - doing the same in Perl would be nice too!
• It's always nice if it's free and open source, but I will pay a few £s if it's really good.
Anyhow, just a few of my humble thoughts...
Re: Favorite or most wanted text editor features?
by Maclir (Curate) on Oct 19, 2001 at 17:52 UTC

One feature that I am surprised no one has mentioned, is:

EMAIL

There is a rule of programming that states that all programs continue to grow and add features until it can end and receive email.

Hmm.... I like that suggestion... but lets make it more complex... okay, PGP encrypted EMAIL, and ICQ style instant messages!

_________________________________________
E-Bitch
Tempora Mutantur Nos et Mutamur in Illis
"The Times are Changed Even as We are Changed in Them"
Emacs does all that

XE has Gnus which reads mail and/or news, and VM which reads mail. So there.

Re: Favorite or most wanted text editor features?
by Albannach (Prior) on Oct 19, 2001 at 17:59 UTC
I've always liked the idea of text folding but for some reason or other I've not ever used a folding editor for any length of time. I haven't looked for a new editor lately either so I'm open to suggestions for a good folding editor to try out.

Of the many other good ideas mentioned by others, I'm not a big fan of syntax highlighting, but I think having the editor jump to lines containing warnings or errors is always very handy.

On implementation, it is important to support many platforms and operate the same way on each to the greatest extent possible, as many people must use several platforms each day.

--
I'd like to be able to assign to an luser

Re: Favorite or most wanted text editor features?
by shadox (Priest) on Oct 19, 2001 at 19:46 UTC

For me, all what I want in a text editor is

• Lightweight
• Fast
• Provides a good and fast movement trought the text

I don't ask too much to a text editor, just the ability to _edit_ text files.
Hey, i am talking about vi :), but i use joe too.

Some other features, like find the "}" who closes this "{" are great, and very useful, but when i think of it, i think in a programing IDE (Komodo is my favorite to the moment), not in a text editor.
Anyway, that was just my opinion, and EvanK good luck with your project.

Dreams they just disapear into the shadows,
then they become true....

Re: Favorite or most wanted text editor features?
by poqui (Deacon) on Oct 19, 2001 at 20:25 UTC
Just and Idea that popped into my head as I was reading this...

What about a MindMap button/command? Its a kind of neural note taking scheme. You are typing along and a related but different idea hits, you could hit this button and a new document opens with a hyperlink to the new doc is deposited in the Previous doc and vice versa.

I ran across a feature kind of like this in a flow charting tool once, I forget which (it might have been Rational Rose several years ago); but it has lain dormant until now!

here! Share and Enjoy! ;-)

"That that is, is... for what is that but that? and is but is?" Shakespeare, Twelfth Night, Act IV, Scene 2

"Yet THAT which is not neither is nor is not That which is!" Frater Perdurabo (pseud. Aleister Crowley), Liber CCCXXXIII, The Book of Lies
Hi,
I have seen other tools with similar features.
• Thebrain.
• ThoughtStream which works on palm.

A 'text' interface within editor would be cool. I have started to Learn Emacs. and want to implement this functionlity in the emacs editor.

Please message me if you have suggestions.

Artist

Re: Favorite or most wanted text editor features?
by FoxtrotUniform (Prior) on Oct 19, 2001 at 20:36 UTC

Heh. I've been threatening to write yet another vi clone for quite some time now (I think the world needs an editor called evil), but every time I start I'm reminded that pretty much everything I want to do, vim already does.... More power to you, though.

Favourite features (in vim):

• Very quick movement around files. This is the biggest feature I can think of. Since I work with code all day, using an editor that doesn't get in my way and lets me jump around the file damn quick is really important to me. This includes ctags, by the way.
• Perl hooks. 'Nuff said.
• Regex search/replace.
• General programming features, like syntax colouring and bracket matching. I like vim's indent and comment options, but the syntax is a bit hirsute.

Most Wanted features (for vim):

• Perl-style regexes. Switching context from Perl regex style to vi regex style is really hard on my poor widdle brain.
• Regex-based comment/indent/syntax hilighting. I haven't looked too closely at vim 6's language files, so this may have been solved.
• Faster, smaller, fewer bugs, you know the drill.

--
:wq
Re: Favorite or most wanted text editor features?
by Elliott (Pilgrim) on Oct 20, 2001 at 18:44 UTC
A feature I've never seen anywhere but would be great for writing CGI code, would be the ability to type in or paste in HTML code and have it automatically escaped properly i.e. all the backslashes inserted where you need 'em.

How about when the HTML code includes JavaScript code??? I'd be impressed with any editor that managed the escapes correctly then!

Done that? OK, next, regexps that work on JS code! (I sometimes use LWP to get HTML pages and repost them with the JavaScript amended. That leads to some very, very nasty regexps.)

Re: Favorite or most wanted text editor features?
by E-Bitch (Pilgrim) on Oct 20, 2001 at 20:24 UTC
Okay, here's my 2 Cents...

Lately, I've been using TextPad, and although a bit limiting, it works pretty well. Take a look at it for possible functionality suggestions :)

Things to include:
1. Syntax Higlighting (included with textpad)
2. Multiple programing language syntax definitions (included with textpad)
3. Regexp Searches (included with textpad)
5. The ability to run command line tools (sorta included with textpad)

I like your suggestion of interpreting perl on the fly... that'd be waaay coool... if you do it modularly, you could somehow plug in other interpreters, such as javascript, or Basic, or even java (you know that the JVM is just an interpreter, right?)

My apologies for this sounding like an ad for textpad... I was using it to compare functionality, and am not trying to advocate it. I would use Emacs or Xemacs, but it looks like those were already covered :)

_________________________________________
E-Bitch
Tempora Mutantur Nos et Mutamur in Illis
"The Times are Changed Even as We are Changed in Them"
Re: Favorite or most wanted text editor features?
by DrManhattan (Chaplain) on Oct 20, 2001 at 23:11 UTC
Multi-level undo is the single greatest feature of vim, IMO. Other highlights include proper arrow and backspace key handing, tabkey filename completion, and colon mode command history.

-Matt

Re: Favorite or most wanted text editor features?
by data64 (Chaplain) on Oct 21, 2001 at 01:37 UTC

Some of the features that were not mentioned above:

• syntax highlighting. I like the visual cue when I mistype a keyword, forget to close a literal string with a terminating quote, etc.
• code completion. That is have a mechanism to complete the variable name I am typing, as long as it has been declared before.
This could be very useful when calling methods on objects, etc.
• while calling a subroutine, displaying the prototype if one has been defined.
• some kind of template feature, so that if I am beginning a new script, then it would have the standard use statements I have in all my script. (eg: use strict;use English;)
Also, useful for adding new modules, oo-packages, etc
• regex search and regex search and replace.
• unlimited undo
• able to interact with some of the common source code control systems (eg: CVS, RCS, perforce)
• Able to do compare files {BTW, EDIFF rocks :-) }
• It should be customizable and extensible, preferrably using perl as the script language.
• cross-platform support. I would like to use the same editor whether I am working on Linux, FRE-BSD, Solaris, Tru64Unix, Windows, VMS or any other OS that comes along.

The popular editors (x)emacs and vim (I don't think much of the plain vanilla vi) do have most of the above things but not all and not as well as I would hope.

Just my .02
Re: Favorite or most wanted text editor features?
by Anonymous Monk on Oct 22, 2001 at 05:53 UTC
History steps would be awesome.
Line numbers are a must.
It would be cool if you could hook up your text editor to the Perl interpreter and run the script from the text editor with some menu command. You could set break points for debugging.
You could use that regexp search/replace feature to look for un-closed brackets or lines with out terminators, or any other little syntax mistakes you tend to make when you haven't had enough coffee :-(

Create A New User
Node Status?
node history
Node Type: perlmeditation [id://119888]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-07-05 21:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?