Connecting Tech Pros Worldwide Help | Site Map

Vim search under cursor

jm.suresh@no.spam.gmail.com
Guest
 
Posts: n/a
#1: Feb 7 '07
Hi, I am using gvim to edit python source files. When I press "*" or
"#", I would want to search for the attribute name under the cursor
and not the entire string.
For example, If I have os.error and pressing * on top of error
searches for os.error rather than error. How to set this, any Idea?

thanks.
-
Suresh

Neil Cerutti
Guest
 
Posts: n/a
#2: Feb 7 '07

re: Vim search under cursor


On 2007-02-07, jm.suresh@no.spam.gmail.com <jm.suresh@gmail.comwrote:
Quote:
Hi, I am using gvim to edit python source files. When I press "*" or
"#", I would want to search for the attribute name under the cursor
and not the entire string.
For example, If I have os.error and pressing * on top of error
searches for os.error rather than error. How to set this, any Idea?
It's will to break things, but you can do this by editing the
iskeyword string and adding in the '.'. :h 'iskeyword'.

--
Neil Cerutti
Wojciech =?ISO-8859-2?Q?Mu=B3a?=
Guest
 
Posts: n/a
#3: Feb 7 '07

re: Vim search under cursor


jm.suresh@no.spam.gmail.com wrote:
Quote:
Hi, I am using gvim to edit python source files. When I press "*" or
"#", I would want to search for the attribute name under the cursor
and not the entire string.
For example, If I have os.error and pressing * on top of error
searches for os.error rather than error. How to set this, any Idea?
Press / then Ctrl-R-A then enter -- of course you should recored it
as a macro.

w.
Closed Thread


Similar Python bytes