vim file +80

will open file in vim, with cursor at line 80

vim file +/if/

will open file in vim, with cursor at first line containing if.

For vim file +80, inside vim, there is gF.

The question:

Inside vim is there any equivalent of vim file +/if/?

which open <cfile> and go to first line that match a pattern.

  • 2
    gF exists because some programs may produce output of the form file:line and such. But file:/pattern/ doesn't seem to occur often. And if you really need it, you can create a mapping of your own.
    – Matt
    Feb 24 '20 at 6:35
  • 1
    Thx, I will try to implement it with custom mapping. Should I close or delete the question, or just leave it alone?
    – qeatzy
    Feb 24 '20 at 6:38
  • 2
    If you're going to implement such functionality and feel it can be of some use and/or interest for others, you can give a self-answer.
    – Matt
    Feb 24 '20 at 6:48
  • 1
    Ctags has output with patterns like this
    – D. Ben Knoble
    Feb 24 '20 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.