I would like to have a new binding so that if im having the cursur on a
word, one shortcut click (say f3) whould find the next occurrence of the
word in the text and so one.
what is the right bind for it ?
I tried [(control s)(control w)] but its wrong.
thanks !
Zvika
--
View this message in context: http://old.nabble.com/one-shortcut-next-occurrence-search-tp30512323p30512323.html
Sent from the Emacs - Help mailing list archive at Nabble.com.
What's wrong with ordinary `C-s C-w C-s C-s ...'?
thanks
Zvika
--
View this message in context: http://old.nabble.com/one-shortcut-next-occurrence-search-tp30512323p30519989.html
Hi!
> I want the the marked word to be found next when I hit f3. maybe
> you'll call me lazy but `C-s C-w' is too much for me ...
I use highlight-symbol.el for that (and many other things):
http://nschum.de/src/emacs/highlight-symbol/
That's my config:
(require 'highlight-symbol)
(global-set-key [f8] 'highlight-symbol-at-point)
(global-set-key [(control f8)] 'highlight-symbol-next)
(global-set-key [(meta f8)] 'highlight-symbol-prev)
So F8 highlights any occurrence of the current word (symbol), C-F8 moves
to the next occurrence, M-F8 to the previous occurrence.
Bye,
Tassilo
You never said anything about the word being "marked", in your
original message. You only talked about "having cursor on a word".
How does the "marked" part enters this picture?
If you are using Viper + Vimpulse - as you should, if you care about
your hands - it is:
* => next occurrence;
# => previous occurrence.
is there anyway where i could search next my makred word
example
if i mark ex1-ex2 from line 1 and I hit f3 i want to it to jump to line 3
and not line2 as it does now :
ex1-ex2 ex3
ex1
ex1-ex2
thanks again
Zvika
--
View this message in context: http://old.nabble.com/one-shortcut-next-occurrence-search-tp30512323p30520429.html
> I want the the marked word to be found next when I hit f3.
> maybe you'll call me lazy but `C-s C-w' is too much for me ...
http://emacswiki.org/cgi-bin/wiki/SearchAtPoint
My version can be found here
http://www.emacswiki.org/emacs/VagnJohansen
--
Vagn Johansen
Hi Zvika,
> is there anyway where i could search next my makred word
> example
>
> if i mark ex1-ex2 from line 1 and I hit f3 i want to it to jump to line 3
> and not line2 as it does now :
>
> ex1-ex2 ex3
> ex1
> ex1-ex2
For me, doing M-x highlight-symbol-next when point is on the first
line's ex1-ex2 jumps to the ex1-ex2 in line 3, just as you want it to
behave.
BTW: I'd pretty much advise against binding that to F3 (or F4), because
these are bound to macre creation and call by default. Those are much
too useful features to override their bindings.
Bye,
Tassilo
The `C-w' is only to "mark" the word, i.e. to say which word(s) you want to
visit. Thereafter, all you need is `C-s' for "the marked word to be found
next". And you can of course use any other key you like (e.g. f3) instead of
`C-s'.
So wrt laziness: hitting `f3' to visit each occurrence is no more difficult than
hitting `f3' to visit each occurrence. ;-)
> ex1-ex2 ex3
> ex1
> ex1-ex2
For that example, if you want to visit only the `ex1-ex2' occurrences, then
start by `C-s C-w C-w'.
Another alternative, besides `C-s' and the one Tassilo mentioned, is `occur'.
You can also access `occur' from `isearch' (`C-s').
And there are `occur' variants (enhancements) that provide other behavior.
Thierry Volpiatto's `ioccur' is one. Icicles's `C-'' is another
(`icicle-occur'). All of these (including vanilla `occur') let you not only
cycle among occurrences but also visit specific occurrences directly.
http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview#toc2
http://www.emacswiki.org/emacs/OccurMode
Maybe M-b C-s C-w in a macro?
But don't use f3 it's already bound to macro recording.
Thats very nifty -- thanks. So now a meta-question Drew: How do I find
out about things like C-w?
Specifically: How do I poke around in the keymap associated with C-s?
IOW, normally to find out about a keybinding, say C-x o, I'd type C-h
c C-x o, but if I do C-h c C-w I get kill-region -- nothing to do with
the C-w 'inside' C-s.
> Specifically: How do I poke around in the keymap associated with C-s?
> IOW, normally to find out about a keybinding, say C-x o, I'd type C-h
> c C-x o, but if I do C-h c C-w I get kill-region -- nothing to do with
> the C-w 'inside' C-s.
You can use keys
C-h m
C-h k
C-h b
in isearch mode to get help. This particular feature is also documented
in Emacs reference manual section "19.1.5 Isearch Yanking".
(info "(emacs) Isearch Yank")
"C-s C-w" is not a keybinding. "C-s" runs isearch-forward, which puts
you into Isearch mode (as you can see into modeline), and you can
learn about its keybindings with "C-h m".
Otherwise, you can try "<prefix key> C-h", that is "C-c C-h", "C-x C-
h" and so on.
> "C-s C-w" is not a keybinding. "C-s" runs isearch-forward, which puts
> you into Isearch mode (as you can see into modeline), and you can
> learn about its keybindings with "C-h m".
>
> Otherwise, you can try "<prefix key> C-h", that is "C-c C-h", "C-x C-
> h" and so on.
Yes, especially C-h b is useful for finding out the bindings for the
preceeding prefix. For example,
C-s C-h b
tells you all bindings of isearch.
Bye,
Tassilo
I didn't know about the "C-h b". What's the difference? Why I have
to type "C-c C-h", "C-x C-h", etc. but "C-s C-h" does not work whilst
"C-s C-h b" does?
Funnily enough, according to "C-h c", "C-c C-h" and "C-x C-h" are not
bound to anything, neither is "C-h" alone (it is a prefix key).
Thanks.
Wrong. "C-h" is not a prefix key, it is bound to "help". However,
I've not been able to figure out this by using help's bindings: "C-h
c", "C-h C-h b", etc.
> Elena <egar...@gmail.com> writes:
>
>> "C-s C-w" is not a keybinding. "C-s" runs isearch-forward, which puts
>> you into Isearch mode (as you can see into modeline), and you can
>> learn about its keybindings with "C-h m".
>>
>> Otherwise, you can try "<prefix key> C-h", that is "C-c C-h", "C-x C-
>> h" and so on.
>
> Yes, especially C-h b is useful for finding out the bindings for the
> preceeding prefix. For example,
>
> C-s C-h b
>
Heh. Learn something new every day ... Thanks!
Actually, Isearch is the exception in this regard. As Elena indicated,
typically all you have to do is hit the prefix key and then `C-h', to see the
bindings on that key.
IIRC, Isearch (`C-s') used to be that way too (Many Moon Ago), but then for a
long time `C-h' didn't work at all for `C-s'. Then Someone(TM) thought it would
be better for `C-s C-h' to give more general help, not just the bindings. So
now you need to add `b' to get the bindings.
[In Isearch+, I bind `C-s C-h' to a version of the standard command
`isearch-mode-help' that (a) gives help about Isearch and (b) lists the Isearch
key bindings. The (a) part is what vanilla Isearch gives you with `C-s C-h m'.
The (b) part is what it gives you with `C-s C-h b'.]
---
I will make a plug here also for command `describe-keymap' in library
help-fns+.el. It is bound to `C-h M-k'. It gives you a human-readable view of
keymaps. The only thing it leaves out (purposely) are menu bindings.
`C-h M-k RET isearch-mode-map' shows you the same thing as `C-s C-h b'. But the
`C-h' trick does not work with all prefix keys. And there are many keymaps that
are not bound to prefix keys.
`C-h M-k' can be useful even for keymaps that you cannot get to easily, such as
the minibuffer keymaps. You can even use it with `global-map'. But you can use
it only for keymaps that are the value of a variable (you are prompted for the
variable name).
Someone(TM)'s infinite wisdom. See my earlier message.
> Funnily enough, according to "C-h c", "C-c C-h" and "C-x C-h" are not
> bound to anything, neither is "C-h" alone (it is a prefix key).
Yes, things like `C-c' are sometimes handled specially to get the `C-h'
behavior. `C-h' does not show up on the keymap (which in the case of `C-c' is
`mode-specific-map'). Try `C-h M-k' and you will see.
Once you know a key you can find the documentation associated with the
function associated with that key very easily.
C-h K C-s
That will take you to section 19.1.1 "Basics of Incremental Search"
where you can browse the documentation isearch-forward bound to to
C-s by default. In 19.1.5 "Isearch Yanking" you will encounter C-w.
The hard part is knowing what key you want to read about. But once
you have the key then you can find the documentation quite easily.
Bob