all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* anyone got a function for backward-to-end-of-word?? ('ge' in vim)
@ 2008-11-10 22:20 David Lam
  2008-11-10 23:11 ` Peter Dyballa
  2008-11-15 10:31 ` Johan Bockgård
  0 siblings, 2 replies; 4+ messages in thread
From: David Lam @ 2008-11-10 22:20 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

hmm i figure someone has had to have written one... this surprisingly useful
key (at least for me) positions the cursor immediately at the end of the
previous word

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

[-- Attachment #2: Type: text/html, Size: 398 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: anyone got a function for backward-to-end-of-word?? ('ge' in vim)
  2008-11-10 22:20 anyone got a function for backward-to-end-of-word?? ('ge' in vim) David Lam
@ 2008-11-10 23:11 ` Peter Dyballa
  2008-11-11  2:37   ` David Lam
  2008-11-15 10:31 ` Johan Bockgård
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Dyballa @ 2008-11-10 23:11 UTC (permalink / raw)
  To: David Lam; +Cc: help-gnu-emacs


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.







^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: anyone got a function for backward-to-end-of-word?? ('ge' in vim)
  2008-11-10 23:11 ` Peter Dyballa
@ 2008-11-11  2:37   ` David Lam
  0 siblings, 0 replies; 4+ messages in thread
From: David Lam @ 2008-11-11  2:37 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]

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.
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 2037 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: anyone got a function for backward-to-end-of-word?? ('ge' in vim)
  2008-11-10 22:20 anyone got a function for backward-to-end-of-word?? ('ge' in vim) David Lam
  2008-11-10 23:11 ` Peter Dyballa
@ 2008-11-15 10:31 ` Johan Bockgård
  1 sibling, 0 replies; 4+ messages in thread
From: Johan Bockgård @ 2008-11-15 10:31 UTC (permalink / raw)
  To: help-gnu-emacs

"David Lam" <david.k.lam1@gmail.com> writes:

> hmm i figure someone has had to have written one... this surprisingly
> useful key (at least for me) positions the cursor immediately at the
> end of the previous word

(require 'misc)

M-x backward-to-word





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-15 10:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-10 22:20 anyone got a function for backward-to-end-of-word?? ('ge' in vim) David Lam
2008-11-10 23:11 ` Peter Dyballa
2008-11-11  2:37   ` David Lam
2008-11-15 10:31 ` Johan Bockgård

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.