Vim search under cursor

J

jm.suresh

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
 
N

Neil Cerutti

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'.
 
W

Wojciech =?ISO-8859-2?Q?Mu=B3a?=

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top