* How to add VIM * functionality in EMACS VIPER mode? [not found] <1131238350.577918.73380@f14g2000cwb.googlegroups.com> @ 2005-11-06 0:55 ` Weihua JIANG 2005-11-06 1:28 ` Lennart Borgman [not found] ` <mailman.14117.1131238523.20277.help-gnu-emacs@gnu.org> 1 sibling, 1 reply; 8+ messages in thread From: Weihua JIANG @ 2005-11-06 0:55 UTC (permalink / raw) [-- Attachment #1.1: Type: text/plain, Size: 416 bytes --] 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 [-- Attachment #1.2: Type: text/html, Size: 458 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to add VIM * functionality in EMACS VIPER mode? 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 0 siblings, 1 reply; 8+ messages in thread From: Lennart Borgman @ 2005-11-06 1:28 UTC (permalink / raw) Cc: help-gnu-emacs 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. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to add VIM * functionality in EMACS VIPER mode? 2005-11-06 1:28 ` Lennart Borgman @ 2005-11-06 2:01 ` Weihua JIANG 2005-11-06 2:12 ` Lennart Borgman 0 siblings, 1 reply; 8+ messages in thread From: Weihua JIANG @ 2005-11-06 2:01 UTC (permalink / raw) Cc: help-gnu-emacs [-- 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to add VIM * functionality in EMACS VIPER mode? 2005-11-06 2:01 ` Weihua JIANG @ 2005-11-06 2:12 ` Lennart Borgman 2005-11-06 2:32 ` Weihua JIANG 0 siblings, 1 reply; 8+ messages in thread From: Lennart Borgman @ 2005-11-06 2:12 UTC (permalink / raw) Cc: help-gnu-emacs Nice. Maybe I as a die hard viper user also should say that I often use C-s to search too. It is very handy when you want to read information. I very often use C-s in Info for example. Weihua JIANG wrote: > 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) > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to add VIM * functionality in EMACS VIPER mode? 2005-11-06 2:12 ` Lennart Borgman @ 2005-11-06 2:32 ` Weihua JIANG 2005-11-06 2:41 ` Lennart Borgman 0 siblings, 1 reply; 8+ messages in thread From: Weihua JIANG @ 2005-11-06 2:32 UTC (permalink / raw) Cc: help-gnu-emacs [-- Attachment #1.1: Type: text/plain, Size: 1245 bytes --] Lennart, Another question about viper: how to change the key for viper modes change? The default one is C-z and I set variable viper-toggle-key to "\C-q" in my .viper file. However, now both C-z and C-q is able to switch between viper modes. But, my hope is to bind C-z to undo as CUA mode does! My environment: emacs 22.0.50 CVS + CUA mode enabled! Anyone can give a help? Thanks, Weihua Jiang 2005/11/6, Lennart Borgman <lennart.borgman.073@student.lu.se>: > > Nice. Maybe I as a die hard viper user also should say that I often use > C-s to search too. It is very handy when you want to read information. I > very often use C-s in Info for example. > > > Weihua JIANG wrote: > > > 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) > > > > [-- Attachment #1.2: Type: text/html, Size: 1868 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to add VIM * functionality in EMACS VIPER mode? 2005-11-06 2:32 ` Weihua JIANG @ 2005-11-06 2:41 ` Lennart Borgman 2005-11-06 2:50 ` Weihua JIANG 0 siblings, 1 reply; 8+ messages in thread From: Lennart Borgman @ 2005-11-06 2:41 UTC (permalink / raw) Cc: help-gnu-emacs In version 22.0.50 viper-toggle-key is a defcustom. Use C-h v viper-toggle-key RET to get the description for the variable. There is an underlined link to "customize" where you can change it. I do not know why it does not work in .viper any more. However the Customize is much better here since you can change it while you are running Emacs. I have entered [(f6)] for the value in Customize. Weihua JIANG wrote: > Lennart, > > Another question about viper: how to change the key for viper modes > change? The default one is C-z and I set variable > viper-toggle-key to "\C-q" in my .viper file. However, now both C-z > and C-q is able to switch between viper modes. But, my hope is to bind > C-z to undo as CUA mode does! > > My environment: emacs 22.0.50 CVS + CUA mode enabled! > > Anyone can give a help? > > Thanks, > Weihua Jiang ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to add VIM * functionality in EMACS VIPER mode? 2005-11-06 2:41 ` Lennart Borgman @ 2005-11-06 2:50 ` Weihua JIANG 0 siblings, 0 replies; 8+ messages in thread From: Weihua JIANG @ 2005-11-06 2:50 UTC (permalink / raw) Cc: help-gnu-emacs [-- Attachment #1.1: Type: text/plain, Size: 1091 bytes --] Lennart Thank you very much! Now it is OK for me! Thanks, Weihua Jiang 2005/11/6, Lennart Borgman <lennart.borgman.073@student.lu.se>: > > In version 22.0.50 viper-toggle-key is a defcustom. Use > > C-h v viper-toggle-key RET > > to get the description for the variable. There is an underlined link to > "customize" where you can change it. I do not know why it does not work > in .viper any more. However the Customize is much better here since you > can change it while you are running Emacs. > > I have entered > > [(f6)] > > for the value in Customize. > > > > Weihua JIANG wrote: > > > Lennart, > > > > Another question about viper: how to change the key for viper modes > > change? The default one is C-z and I set variable > > viper-toggle-key to "\C-q" in my .viper file. However, now both C-z > > and C-q is able to switch between viper modes. But, my hope is to bind > > C-z to undo as CUA mode does! > > > > My environment: emacs 22.0.50 CVS + CUA mode enabled! > > > > Anyone can give a help? > > > > Thanks, > > Weihua Jiang > > > [-- Attachment #1.2: Type: text/html, Size: 1548 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <mailman.14117.1131238523.20277.help-gnu-emacs@gnu.org>]
* Re: How to add VIM * functionality in EMACS VIPER mode? [not found] ` <mailman.14117.1131238523.20277.help-gnu-emacs@gnu.org> @ 2005-11-06 1:38 ` Bastien 0 siblings, 0 replies; 8+ messages in thread From: Bastien @ 2005-11-06 1:38 UTC (permalink / raw) Weihua JIANG writes: > 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? C-s C-w do the job. -- Bastien ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-11-06 2:50 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [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 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
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).