Friday, November 25, 2011

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

On Fri, Nov 25, 2011 at 11:31 PM, Tim Chase <vim@tim.thechases.com> wrote:
> On 11/25/11 09:33, Fabio Spelta wrote:
>>
>> 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.

Here is my solution:
nmap <F1> 0f.lyt.:e <c-r>0.txt<cr>


--
Albin Olsson, IT Consultant and Classic Connoisseur
www.albinolsson.se | albin.olsson@gmail.com
+46 707 831 830

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

Post a Comment