At Thu, 12 Nov 2009 10:05:36 -0000 (GMT), (Ted Harding) wrote:
On 12-Nov-09 09:35:00, Brett Parker wrote:
On 12 Nov 09:23, Srdjan Todorovic wrote:
On 12/11/2009, Mark Rogers mark@quarella.co.uk wrote:
I'm sorry, but Vi/Emacs might suit some people but I'm not one of them (I probably was once upon a time). (PS: If I want a text-mode editor I tend to use joe - Wordstar compatible key bindings anyone?)
What do you mean by text-mode editor?
I believe he means "console" as apposed to a gtk window...
gvim is graphical.
at which point that's a fail ;) (but good ol' normal vim is fine).
Anyways - I'm an avid vim user - but I can understand that there are people out there that don't want to just get things done, and so don't want to bother to learn the (very useful) bits of vim... for those, there's always jedit - which is one of the better graphical editors I've used... or Kate (yes, it's KDE, but it's actually not bad), or, IIRC, scite isn't too bad.
(Now, if we can keep the thread out of the realms of windows software... especially for text editors... ;)
Ta,
Brett Parker
Interesting thread! Now that it looks as though vim is romping home in its rightful place at the head of the field, let me ask advocates of other editors how they would achieve the following editing task.
You have a long document, in which are lots of occurrences of numbers which have the Contintental separator system ("." to separate thousands, "," for the decimal point). So, for instance, one million Francs and 25 Centimes is 1.000.000,25
Now run a global edit to convert these into the Real Thing, so that the above example becomes 1,000,000.25 for instance.
(OK, maybe there are editors which simply have a drop-down menu item which says "Convert to British", but that's MS-style "It seems you're trying to convert between Continental and British numbering. Never mind, I'll do it all for you; go make a coffee" and may well be flaky ... so I consider that cheating ... ).
Talking of which, time to take tongue out of cheek and make that coffee.
Here's some elisp:
(defun switch-currency-separators-buffer (old-group-separator old-decimal-separator) (interactive (let ((g-s (read-from-minibuffer "Old group separator: " ".")) (d-s (read-from-minibuffer "Old decimal separator: " ","))) (list g-s d-s))) (save-excursion (goto-char (point-min)) (while (re-search-forward (format "\b\([0-9\%s]+\)\%s\([0-9][0-9]\)\b" old-group-separator old-decimal-separator) nil t) (replace-match (concat (replace-regexp-in-string (format "\%s" old-group-separator) old-decimal-separator (match-string-no-properties 1)) old-group-separator (match-string-no-properties 2))))))
(defun switch-currency-separators-region (beg end old-group-separator old-decimal-separator) (interactive (let ((g-s (read-from-minibuffer "Old group separator: " ".")) (d-s (read-from-minibuffer "Old decimal separator: " ","))) (list (region-beginning) (region-end) g-s d-s))) (save-excursion (goto-char beg) (while (and (re-search-forward (format "\b\([0-9\%s]+\)\%s\([0-9][0-9]\)\b" old-group-separator old-decimal-separator) nil t) (<= (point) end)) (replace-match (concat (replace-regexp-in-string (format "\%s" old-group-separator) old-decimal-separator (match-string-no-properties 1)) old-group-separator (match-string-no-properties 2))))))