all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Weihua JIANG <weihua.jiang@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to add VIM * functionality in EMACS VIPER mode?
Date: Sun, 6 Nov 2005 10:01:17 +0800	[thread overview]
Message-ID: <266164370511051801n8fd4980o@mail.gmail.com> (raw)
In-Reply-To: <436D5C27.1050707@student.lu.se>


[-- Attachment #1.1: Type: text/plain, Size: 1193 bytes --]

Lennart,
 Thank you very much! Now I have the * functionality in VIPER mode. Below is
my code:

(defun search-at-point ()
"Put symbol at current point into search string."
(interactive)
(setq viper-s-string (concat "\\<" (symbol-name (symbol-at-point)) "\\>"))
(setq viper-s-forward t)
;; TODO: Handle case where symbol-at-point returns nil.
(viper-search viper-s-string viper-s-forward 1))

(define-key viper-vi-global-user-map (kbd "*") 'search-at-point)

Thanks,
Weihua, Jiang

 2005/11/6, Lennart Borgman <lennart.borgman.073@student.lu.se>:
>
> Weihua JIANG wrote:
>
> > In normal mode of VIM, there is a very good functionality: when cursor
> > under any position of a word, you can press key "*" to use the whole
> > word under cursor (including both the chars before the cursor and after
> > it) as search pattern.
> >
> > Now I switched to EMACS with VIPER mode. But VIPER lacks such
> > functionality. Can any one tell me how to implement it in VIPER with
> > some elisp code?
> >
> > Thanks
> > Weihua Jiang
>
> Hi Weihua,
>
> This has been discussed on EmacsWiki, see
> http://emacswiki.org/cgi-bin/wiki/SearchAtPoint for several solutions.
>

[-- Attachment #1.2: Type: text/html, Size: 1770 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

  reply	other threads:[~2005-11-06  2:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1131238350.577918.73380@f14g2000cwb.googlegroups.com>
2005-11-06  0:55 ` How to add VIM * functionality in EMACS VIPER mode? Weihua JIANG
2005-11-06  1:28   ` Lennart Borgman
2005-11-06  2:01     ` Weihua JIANG [this message]
2005-11-06  2:12       ` Lennart Borgman
2005-11-06  2:32         ` Weihua JIANG
2005-11-06  2:41           ` Lennart Borgman
2005-11-06  2:50             ` Weihua JIANG
     [not found] ` <mailman.14117.1131238523.20277.help-gnu-emacs@gnu.org>
2005-11-06  1:38   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=266164370511051801n8fd4980o@mail.gmail.com \
    --to=weihua.jiang@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.