Loading ...
Sorry, an error occurred while loading the content.

getting the word under the cursor

Expand Messages
  • Normandie Azucena
    hi all! how can I get the word under the cursor? im doing a script and I want my input to be the current word under the cursor tnx! normandie
    Message 1 of 3 , May 3 10:44 PM
    • 0 Attachment
      hi all!

      how can I get the word under the cursor?

      im doing a script and I want my input to be the current word under the
      cursor

      tnx!
      normandie
    • Sartak
      ... Most likely, you re in insert mode, CTRL-R CTRL-W puts the current word under the cursor into whatever you re editing (though it seems to be a no-op in
      Message 2 of 3 , May 3 10:56 PM
      • 0 Attachment
        On 5/4/07, Normandie Azucena <Normandie.Q.Azucena@...> wrote:
        >
        >
        > hi all!
        >
        > how can I get the word under the cursor?
        >
        > im doing a script and I want my input to be the current word under the
        > cursor
        >
        > tnx!
        > normandie
        >
        >

        Most likely, you're in insert mode, CTRL-R CTRL-W puts the current
        word under the cursor into whatever you're editing (though it seems to
        be a no-op in insert mode), whether it be an ex command or a search or
        whatever.

        If you're not actually going to be in insert mode, then you can yiw
        (yank inner word) to some register and use that. There's probably a
        better way (especially if you're searching for the word.. see the *
        and # commands).

        Shawn M Moore
      • Sanjeev Sapre
        I have put this in my _vimrc and works well put word below cursor onto clipboard map :let @* = expand( ) map! :let @* =
        Message 3 of 3 , May 3 11:43 PM
        • 0 Attachment
          I have put this in my _vimrc and works well


          " put word below cursor onto clipboard
          map <F4> :let @* = expand('<cword>')<cr>
          map! <F4> <Esc>:let @* = expand('<cword>')<cr>



          Regards
          Sanjeev

          Ext : 2852

          -----Original Message-----
          From: Normandie Azucena [mailto:Normandie.Q.Azucena@...]
          Sent: Friday, May 04, 2007 11:14 AM
          To: vim@...
          Subject: getting the word under the cursor



          hi all!

          how can I get the word under the cursor?

          im doing a script and I want my input to be the current word under the
          cursor

          tnx!
          normandie
        Your message has been successfully submitted and would be delivered to recipients shortly.