http://www.perlmonks.org?node_id=34666


in reply to RE: Editor tricks.
in thread Editor tricks.

I use vi, vim and Xemacs mostly. In windows I use Notepad just because it's there. I don't use windows for anything bar playing the odd game so I don't have to do any heavy work in it. The posts about Notepad+ caught my eye though, I'll check it out.

With regards to editors under unix, I have long tried to stay away from the religious aspect of it although I think the flame fests can be funny they are getting a little tiring. Not that anything I think is going to stop history repeating itself. Many of the new college graduates I've worked with arrive into the company not really caring what they use but within weeks they are either raving vi nuts or raving emacs nuts. It's a cultural marker I suppose.

I use vi or vim for system administration type work and for writing small bits of noddy code like the average perl script you see posted around here. For serious, project work, tracking down bugs in large collections of software or anything else of that nature I use emacs. I learn something new about emacs every now and again, it doesn't give up it's secrets too easily. Many would hate it for that. I love it for that. Why ? Well here are just a few of the reasons.

  1. Elisp. Imagine having an editor where you could write little pieces of Perl, name these functions and run them at will against the text in your editor. Thats what Elisp gives you in emacs.
  2. VM. Exactly the same environment for my mailer as for my editor. That's because my editor is also my mailer. Many have moved on to Mutt. Off with them I say. There's something soothing about being able to use the same keystrokes and functions in multiple applications. This extends I suppose to all applications that use the readline library including bash itself. I don't have access to a news-feed except for Deja but if I did I would use emacs for that too.
  3. M-q fill-paragraph. I mentioned this one in a previous post. There's nothing magical about it but it makes my life easier. Fscks up mightily on troff and other formats where there are no blank lines between paragraphs but everything has got its limitations, right ?.
  4. re-search-forward, re-search-backward. I don't have to tell Perl coders how useful being able to search for regexes is. The elisp regex flavour is ugly compared to Perls but it is basic and once you get over the leaning toothpick syndrome it's not too bad.
  5. BBDB. The Big Brother Database. Sits at the bottom of your VM frame in a separate window and it scans emails as they come in talking out names, alternate email addresses. Very useful, you soon build up a database of names, email addresses, phone numbers and addresses and half the time you don't even see it happening.
  6. Consistency. C-f goes forward a character, M-f goes forward a word. In the various programming modes they will go forward something equivalent, usually an expression instead of a word.

Replies are listed 'Best First'.
RE: RE: RE: Editor tricks.
by nuance (Hermit) on Sep 30, 2000 at 01:53 UTC
    Among my personal favoutite things about emacs are
    • the query replace functions
    • ediff (I can't say eough good things about this) - lets you do interactive diffs/merges on 2 or three files. Diffs are shown in different colors.
    • the comment aligning functions in most programming major modes. M-;
    • the way the tab key works. In text mode it aligns to the start of words in the line above, which makes colums really easy to do. In most programming modes it reindents the curent line. And it always does consistant formatting of the white space when you hit the tab key (i.e. it converts as many spaces at the begining to tabs as possible and fills the rest with space characters.
    • You can convert all tabs to spaces if you want
    And various other wonderful things too numerous to mention here.

    Nuance

(bbfu) (Perl in Vim) Re: (Dermot) RE: RE: Editor tricks.
by bbfu (Curate) on Sep 04, 2002 at 03:41 UTC

    I know this is a bit late, but I just found this thread. :)

    Quoth Dermot:

    Imagine having an editor where you could write little pieces of Perl, name these functions and run them at will against the text in your editor.

    With Vim with Perl compiled in, you can do exactly that. With Perl. It's pretty slick.

    bbfu
    Black flowers blossum
    Fearless on my breath
    Teardrops on the fire
    Fearless on my breath