Thursday, August 26, 2010

Re: Getting word under cursor

Птн, 27 Авг 2010, Gusman писал(а):
> Hi,
>
> Currently I want to make to script that grepping word under cursor in my
> project files.
> But until know I still confuse how to get the word under cursor, I've been
> used expand("<cword>") but
> I just return the first word of line and the last one.
>
> Thank you.
>
> Best Regards,
>
>
> Gusman Dharma P

It works for me. Can you report what if you input a line such as
cat mouse dog

then move cursor on any one word, then switch to command mode, type
:echo expand("<cword>")

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: