betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

19 November 2005

Editor Wars: Keyboard Shortcuts for Regex

vi rules (once more)

In the book "Code Reading" by Diomidis Spinellis, there is a small table about what commands are needed to search in code editors. (Section 10.1 "Regular Expressions" serves to remind programmers that regular expression can be a powerfull tool when trying to find your way around foreign (and own) source code. As a vi user I think the table is incredible funny and revealing:

Table 10.2 Regular Expression Search Commands in Popular Editors
Editor Forward Search Command Backward Search Command
BRIEF [a] Search Forward Search Backward
Emacs C-M-s [b] isearch-forward-regexp C-M-r isearch-backward-regexp
Epsilon C-A-s [c] regex-search C-A-R reverse-regex-search
vi / ?
Visual Studio FindRegExpr FindRegExprPrev

[a] After performing a regular expression toggle.
[b] Control-Meta-s.
[c] Control-Alt-s.

Of course you might not get my fine point here. So let me explain what I learned: First, there are some editors around that I have never heard of, like "BRIEF" and "Epsilon". But the highlight is the complexity of these commands. In vi it's just one single character for each, while others have something that I can only assume to be menu commands, not to mention three letter salute keyboard shortcuts. Of course it's maybe harder to grab the concept of vi editing, but once you got it, you are rewarded with simplicity and no waste of time for such an often used tool.

Posted by betabug at 13:21 | Comments (2) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< New HelMUG Website Online | Main | HelMUG @ COMDEX >>
Re: Editor Wars: Keyboard Shortcuts for Regex

The really interesting thing instead is how to use the regular expressions.
To be accustomed to use VI you won't get
expected results in visual studio.
There a comparison would be good....

Posted by: Thomas Lehmann at December 06,2005 10:37
Re: Editor Wars: Keyboard Shortcuts for Regex

Ah, don't mention it. Subtle (and not so subtle) differences in regex syntax sometimes drive me up the trees. Most implementations can't even agree if \( or ( is the grouping character, so each time I use regex somewhere else I have to test it out. And it doesn't get any better with many a documentation just mentioning that "you can use xy compatible regex syntax", which means "look up *that* documentation too.

There is a bit of a comparison table in "Mastering Regular Expressions" (the O'Reilly book). I used to have the first edition. The book also mentions that many implementations go closer to the quasi standard "perl compatible", but I guess visual studio won't likely do that.

Posted by: betabug at December 06,2005 10:55
You can trackback to:
There are no trackbacks.