unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to produce the effect of * and # of VIM in Emacs?
@ 2005-07-27 14:35 Emre Sevinc
  2005-07-27 16:09 ` Marc Tfardy
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Emre Sevinc @ 2005-07-27 14:35 UTC (permalink / raw)



Hello,

What I'm trying to learn is how to produce the effect 
of * and # of VIM in Emacs.

I know I can make something like that:

M-b C-s C-w

I'd like to learn how can I make it with a single keystroke 
(key combination) or write some elisp function that
does so.

Any suggestions?

Thanks in advance.

-- 
Emre Sevinc

eMBA Software Developer         Actively engaged in:
http:www.bilgi.edu.tr           http://ileriseviye.org
http://www.bilgi.edu.tr         http://fazlamesai.net
Cognitive Science Student       http://cazci.com
http://www.cogsci.boun.edu.tr

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

* Re: How to produce the effect of * and # of VIM in Emacs?
  2005-07-27 14:35 How to produce the effect of * and # of VIM in Emacs? Emre Sevinc
@ 2005-07-27 16:09 ` Marc Tfardy
  2005-07-27 16:47   ` Micha Feigin
       [not found]   ` <mailman.1903.1122483641.20277.help-gnu-emacs@gnu.org>
  2005-07-27 17:25 ` Vagn Johansen
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Marc Tfardy @ 2005-07-27 16:09 UTC (permalink / raw)


Emre Sevinc schrieb:
> Hello,
> 
> What I'm trying to learn is how to produce the effect 
> of * and # of VIM in Emacs.
> 
> I know I can make something like that:
> 
> M-b C-s C-w
> 
> I'd like to learn how can I make it with a single keystroke 
> (key combination) or write some elisp function that
> does so.
> 
> Any suggestions?

One stupid question - what do * and # in VIM?

regards

Marc

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

* Re: How to produce the effect of * and # of VIM in Emacs?
  2005-07-27 16:09 ` Marc Tfardy
@ 2005-07-27 16:47   ` Micha Feigin
       [not found]   ` <mailman.1903.1122483641.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Micha Feigin @ 2005-07-27 16:47 UTC (permalink / raw)


On Wed, 27 Jul 2005 17:09:19 +0100
Marc Tfardy <m-t-o___CUT_IT___@web.de> wrote:

> Emre Sevinc schrieb:
> > Hello,
> > 
> > What I'm trying to learn is how to produce the effect 
> > of * and # of VIM in Emacs.
> > 
> > I know I can make something like that:
> > 
> > M-b C-s C-w
> > 
> > I'd like to learn how can I make it with a single keystroke 
> > (key combination) or write some elisp function that
> > does so.
> > 
> > Any suggestions?
> 
> One stupid question - what do * and # in VIM?
> 

Search forward and backward for the word under the cursor

You can make a macro from this sequence and bind it to a key

You may also want to have a look at the highlight-regexp package at
http://www.geekware.de/software/emacs/

> regards
> 
> Marc
> 
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>  
>  +++++++++++++++++++++++++++++++++++++++++++
>  This Mail Was Scanned By Mail-seCure System
>  at the Tel-Aviv University CC.
> 

 
 +++++++++++++++++++++++++++++++++++++++++++
 This Mail Was Scanned By Mail-seCure System
 at the Tel-Aviv University CC.

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

* Re: How to produce the effect of * and # of VIM in Emacs?
  2005-07-27 14:35 How to produce the effect of * and # of VIM in Emacs? Emre Sevinc
  2005-07-27 16:09 ` Marc Tfardy
@ 2005-07-27 17:25 ` Vagn Johansen
  2005-07-27 21:02   ` Emre Sevinc
  2005-07-27 17:41 ` Kevin Rodgers
       [not found] ` <mailman.1914.1122487618.20277.help-gnu-emacs@gnu.org>
  3 siblings, 1 reply; 10+ messages in thread
From: Vagn Johansen @ 2005-07-27 17:25 UTC (permalink / raw)


Emre Sevinc <emres@bilgi.edu.tr> writes:

> Hello,
>
> What I'm trying to learn is how to produce the effect 
> of * and # of VIM in Emacs.

Functions that do that can be found here:

http://www.emacswiki.org/cgi-bin/wiki/VagnJohansen

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

* Re: How to produce the effect of * and # of VIM in Emacs?
       [not found]   ` <mailman.1903.1122483641.20277.help-gnu-emacs@gnu.org>
@ 2005-07-27 17:29     ` Emre Sevinc
  2005-07-27 20:17       ` kgold
  0 siblings, 1 reply; 10+ messages in thread
From: Emre Sevinc @ 2005-07-27 17:29 UTC (permalink / raw)


Micha Feigin <michf@post.tau.ac.il> writes:

> On Wed, 27 Jul 2005 17:09:19 +0100
> Marc Tfardy <m-t-o___CUT_IT___@web.de> wrote:
>
>> Emre Sevinc schrieb:
>> > Hello,
>> > 
>> > What I'm trying to learn is how to produce the effect 
>> > of * and # of VIM in Emacs.
>> > 
>> > I know I can make something like that:
>> > 
>> > M-b C-s C-w
>> > 
>> > I'd like to learn how can I make it with a single keystroke 
>> > (key combination) or write some elisp function that
>> > does so.
>> > 
>> > Any suggestions?
>> 
>> One stupid question - what do * and # in VIM?
>> 
>
> Search forward and backward for the word under the cursor
>
> You can make a macro from this sequence and bind it to a key

I tried that by pressing C-x (  and then pressing M-b C-s C-w
and then C-x ) and Emacs said that a macro is defined, then I
came to the middle of the word pressed C-x e to execute the
macro but the cursor just stayed there, nothing happened.
Any ideas why that doesn't work? Is it related to I-search's
being interactive and interfering with the macro creation process?


> You may also want to have a look at the highlight-regexp package at
> http://www.geekware.de/software/emacs/

Very nice package! It does %99 of what I have described in 
my original post.

One question: I have tried the functions in that package and
it does the highlighting but once all the occurences of word
are highlighted how can I jump to them as: next occurence, next occurence,
..., ?


-- 
Emre Sevinc

eMBA Software Developer         Actively engaged in:
http:www.bilgi.edu.tr           http://ileriseviye.org
http://www.bilgi.edu.tr         http://fazlamesai.net
Cognitive Science Student       http://cazci.com
http://www.cogsci.boun.edu.tr

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

* Re: How to produce the effect of * and # of VIM in Emacs?
  2005-07-27 14:35 How to produce the effect of * and # of VIM in Emacs? Emre Sevinc
  2005-07-27 16:09 ` Marc Tfardy
  2005-07-27 17:25 ` Vagn Johansen
@ 2005-07-27 17:41 ` Kevin Rodgers
       [not found] ` <mailman.1914.1122487618.20277.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 10+ messages in thread
From: Kevin Rodgers @ 2005-07-27 17:41 UTC (permalink / raw)


Emre Sevinc wrote:
 > What I'm trying to learn is how to produce the effect
 > of * and # of VIM in Emacs.
 >
 > I know I can make something like that:
 >
 > M-b C-s C-w
 >
 > I'd like to learn how can I make it with a single keystroke
 > (key combination) or write some elisp function that
 > does so.

Since you know the equivalent key sequence, it's just a macro:

(global-set-key "*" "\M-b\C-s\C-w")

-- 
Kevin Rodgers

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

* Re: How to produce the effect of * and # of VIM in Emacs?
       [not found] ` <mailman.1914.1122487618.20277.help-gnu-emacs@gnu.org>
@ 2005-07-27 18:34   ` Emre Sevinc
  0 siblings, 0 replies; 10+ messages in thread
From: Emre Sevinc @ 2005-07-27 18:34 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Emre Sevinc wrote:
>  > What I'm trying to learn is how to produce the effect
>  > of * and # of VIM in Emacs.
>  >
>  > I know I can make something like that:
>  >
>  > M-b C-s C-w
>  >
>  > I'd like to learn how can I make it with a single keystroke
>  > (key combination) or write some elisp function that
>  > does so.
>
> Since you know the equivalent key sequence, it's just a macro:
>
> (global-set-key "*" "\M-b\C-s\C-w")

After reading your post I tried that by typing it
in scratch buffer and pressing C-j however whatever
macro it created, it did not work when I came over
a word and pressed that character.

Then I tried to unset it by using global-unset-key
in a similar way, it didn't give any error but
when I press that key it beeps and doesn't do anything,
I have also tried using the interactive form 
M-x global-unset-key and give that character as a
parameter, but nothing changed :(

How can I unset and be able to use it as before?

BTW, my GNU Emacs is version 21.3.1

Thanks in advance.


-- 
Emre Sevinc

eMBA Software Developer         Actively engaged in:
http:www.bilgi.edu.tr           http://ileriseviye.org
http://www.bilgi.edu.tr         http://fazlamesai.net
Cognitive Science Student       http://cazci.com
http://www.cogsci.boun.edu.tr

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

* Re: How to produce the effect of * and # of VIM in Emacs?
  2005-07-27 17:29     ` Emre Sevinc
@ 2005-07-27 20:17       ` kgold
  2005-07-27 20:52         ` Emre Sevinc
  0 siblings, 1 reply; 10+ messages in thread
From: kgold @ 2005-07-27 20:17 UTC (permalink / raw)


Emre Sevinc <emres@bilgi.edu.tr> writes:
> >
> > Search forward and backward for the word under the cursor
> >
> > You can make a macro from this sequence and bind it to a key
> 
> I tried that by pressing C-x (  and then pressing M-b C-s C-w
> and then C-x ) and Emacs said that a macro is defined, then I
> came to the middle of the word pressed C-x e to execute the
> macro but the cursor just stayed there, nothing happened.
> Any ideas why that doesn't work? Is it related to I-search's
> being interactive and interfering with the macro creation process?

You need one more C-s.  C-w says search for the word, and the second
C-s says to get the next match.

-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646

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

* Re: How to produce the effect of * and # of VIM in Emacs?
  2005-07-27 20:17       ` kgold
@ 2005-07-27 20:52         ` Emre Sevinc
  0 siblings, 0 replies; 10+ messages in thread
From: Emre Sevinc @ 2005-07-27 20:52 UTC (permalink / raw)


kgold@watson.ibm.com (kgold) writes:

> Emre Sevinc <emres@bilgi.edu.tr> writes:
>> >
>> > Search forward and backward for the word under the cursor
>> >
>> > You can make a macro from this sequence and bind it to a key
>> 
>> I tried that by pressing C-x (  and then pressing M-b C-s C-w
>> and then C-x ) and Emacs said that a macro is defined, then I
>> came to the middle of the word pressed C-x e to execute the
>> macro but the cursor just stayed there, nothing happened.
>> Any ideas why that doesn't work? Is it related to I-search's
>> being interactive and interfering with the macro creation process?
>
> You need one more C-s.  C-w says search for the word, and the second
> C-s says to get the next match.

Unfortunately that did not create the effect I'm searching
for. As you suggested C-x ( M-b C-s C-w C-s ) and then C-x e
but it didn't do what I described.

Alternatively I tried these in *scratch*:

(global-set-key (kbd "C-*") "\M-b\C-s\C-s\C-w")

(global-set-key (kbd "C-*") "\M-b\C-s\C-w\C-s")

which didn't work, too.

I don't know what I doing wrong if I can't handle
it with simple keyboard macro way then I'll have 
to use the elisp functions from the suggested packages
(even though I think they are a little bit overkill
for just the single thing I want (besides that, they 
are nice and providing functionality I liked)).


-- 
Emre Sevinc

eMBA Software Developer         Actively engaged in:
http:www.bilgi.edu.tr           http://ileriseviye.org
http://www.bilgi.edu.tr         http://fazlamesai.net
Cognitive Science Student       http://cazci.com
http://www.cogsci.boun.edu.tr

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

* Re: How to produce the effect of * and # of VIM in Emacs?
  2005-07-27 17:25 ` Vagn Johansen
@ 2005-07-27 21:02   ` Emre Sevinc
  0 siblings, 0 replies; 10+ messages in thread
From: Emre Sevinc @ 2005-07-27 21:02 UTC (permalink / raw)


Vagn Johansen <gonz808@hotmail.com> writes:

> Emre Sevinc <emres@bilgi.edu.tr> writes:
>
>> Hello,
>>
>> What I'm trying to learn is how to produce the effect 
>> of * and # of VIM in Emacs.
>
> Functions that do that can be found here:
>
> http://www.emacswiki.org/cgi-bin/wiki/VagnJohansen

Thank you very much for providing the URL, I just
visited them and it looks like it does what I want
perfectly (incorporating highlighting would be 
a nice feature even though that's also optional in VIM)



-- 
Emre Sevinc

eMBA Software Developer         Actively engaged in:
http:www.bilgi.edu.tr           http://ileriseviye.org
http://www.bilgi.edu.tr         http://fazlamesai.net
Cognitive Science Student       http://cazci.com
http://www.cogsci.boun.edu.tr

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

end of thread, other threads:[~2005-07-27 21:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-27 14:35 How to produce the effect of * and # of VIM in Emacs? Emre Sevinc
2005-07-27 16:09 ` Marc Tfardy
2005-07-27 16:47   ` Micha Feigin
     [not found]   ` <mailman.1903.1122483641.20277.help-gnu-emacs@gnu.org>
2005-07-27 17:29     ` Emre Sevinc
2005-07-27 20:17       ` kgold
2005-07-27 20:52         ` Emre Sevinc
2005-07-27 17:25 ` Vagn Johansen
2005-07-27 21:02   ` Emre Sevinc
2005-07-27 17:41 ` Kevin Rodgers
     [not found] ` <mailman.1914.1122487618.20277.help-gnu-emacs@gnu.org>
2005-07-27 18:34   ` Emre Sevinc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).