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

86249Checking whether the word under the cursor is followed by "("

Expand Messages
  • Szabolcs
    Jan 6, 2008
    • 0 Attachment
      I would like to use K to look up words in the documentation of some
      product (html pages on the hard drive). However, the path to a doc
      page should be different depending on whether the word under the
      cursor is followed by "(" [an opening paren] (possibly preceded by
      some white space), or not. In the second case the path looks like
      baseurl/wordUnderCursor.html, while in the first case baseurl/
      wordUnderCursor_.html is tried first, and if it doesn't exist, then
      baseurl/wordUnderCursor.html is tried also.

      What is a good way of checking whether the word under the cursor is
      followed by "("? I tried using search("\%#\k+\s*(", "cn"), but it
      doesn't seem to work. It always returns 0. (Actually this is the
      first time I'm trying to do something more complicated with vimscript
      than setting options or mapping keys ...)

      Thanks for any suggestion in advance,
      Szabolcs
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Show all 3 messages in this topic