Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • If you change the pattern just to position the cursor at the point you're interested in then you can yank the next word into a register with a separate command:

    function! GotoCFile()
      if search('\v%(^\s*#\s*cfile:\s*)@<=\w')
        normal "zye
        echo 'Found ' . @z
        echo 'Could not find name of corresponding file'

    If however, as suggested by the name of your function, your actual desire is not to put the filename into a variable but to go

    • Thanks! That's useful information. I have to admit, I'm thinking about Emacs just because I find the Vim docs so intensely painful. I'm not Stephen Hawking, but I'm not particularly stupid, either. I don't know why I have such trouble with the Vim docs, but I do. This really should have not been so hard to figure out :/