Friday, November 25, 2011

Open a file whose name is selected after a search pattern in the current line

Hello all,
I can't find a way to do that and I hope to find help here (thanks in
advance for reading).

Suppose I have a file that reads like

sometxt1 somemoretxt2 abc.TEXTIWANT3.cde
sometxt2 somemoretxt5 fgh.TEXTIWANT6.ijk

and so on.

I want to extract the TEXTIWANTX part and open a file named
TEXTIWANTX.txt by executing a command (hitting a key, whatever) when I
am on a line formatted like that.
Of course the difficult part is not finding an expression that matches
the text I want, by the way. I would love to assign that to a variable
and split-open a file named $variable.txt, or any other solution that
could serve the purpose.

Thank you all for any help!

--
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: