help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: anyone got a function for backward-to-end-of-word?? ('ge' in vim)


From: David Lam
Subject: Re: anyone got a function for backward-to-end-of-word?? ('ge' in vim)
Date: Mon, 10 Nov 2008 18:37:45 -0800

hey cool thanks, i took ians function and modified it a little ... this seems to work okay i think... 

;; 32 = ASCII <space>
(defun prev-word-end-three (&optional arg)
 (interactive "p")
 (let ((arg (or arg 1)))
   (cond
    ((= (preceding-char) 32)  (progn (backward-word (+ arg)) (forward-word))) ;; bw fw
    (t  (progn (backward-word (+ 1 arg)) (forward-word)))                     ;; bw bw fw
    )                             
 );; let
);;defun

 (global-set-key "\C-x\M-b" 'prev-word-end-three)
 (global-set-key "\M-B" 'prev-word-end-three)


On Mon, Nov 10, 2008 at 3:11 PM, Peter Dyballa <Peter_Dyballa@web.de> wrote:

Am 10.11.2008 um 23:20 schrieb David Lam:


So for example if you had...

     'fooz bar'

...with the cursor anywhere within 'bar', pressing ge in vi immediatley
positions the cursor at the 'z' !!!1


You could create one! Comprised of backward-word, backward-word, forward-word, delete-backward-char ... And bind it to some key.

--
Greetings

 Pete

We have to expect it, otherwise we would be surprised.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]