El sábado, 17 de agosto de 2013 11:16:05 UTC+2, Javier Mediavilla Vegas  
escribió:
> El viernes, 16 de agosto de 2013 19:15:36 UTC+2, Javier Mediavilla Vegas  
> escribió:
> 
> > Hi all,
> 
> > Is there any command or any method that allows to include a file in the 
> > current file you are editing?
> 
> > 
> 
> > By including a file I don't mean to read it with :read and paste it. I mean 
> > something like 
> 
> >     \include{file}
> 
> > 
> 
> > The semantic that I am looking can be (merely an example):
> 
> >     In normal mode, if some include is expanded, it deletes it contents and
> 
> >        replaces the \include statement
> 
> > 
> 
> >     In insert mode, when the cursor is hover the line the include is 
> > written, vim 
> 
> >        reads the file, and copy its content to the line the statement was.
> 
> > 
> 
> > Basically, I would like to have a conceal behaviour for such an order that 
> > loads a file as is in that moment so changes in the file included are 
> > reflected in the file that includes it.
> 
> > 
> 
> > Thanks in advance,
> 
> > 
> 
> > Regards,
> 
> > Javier.
> 
> 
> 
> Sorry for not putting an example.
> 
> I want to achieve a latex like behaviour. For example:
> 
> 
> 
> ---- snippet.txt ----
> 
> this is a snippet
> 
> 
> 
> ---- main.txt ----
> 
> this is the main text
> 
> \include{snippet.txt}
> 
> 
> 
> So, If I hover the cursor over line 2 of main.txt in insert mode, vim 
> substitutes \include{snippet.txt} by its contents.
> 
> 
> 
> ---- main.txt ----
> 
> this is the main text
> 
> this is a snippet
> 
> 
> 
> If I exit insert mode, the text becomes again as before, with \include. 
> Suppose now I change the file snippet.txt to
> 
> 
> 
> ---- snippet.txt ----
> 
> this is a snippet
> 
> added some new stuff
> 
> 
> 
> Then, with main.txt opened, hover over \include{snippet.txt} to get
> 
> 
> 
> ---- main.txt ----
> 
> this is the main text
> 
> this is a snippet
> 
> added some new stuff
> 
> 
> 
> When I change to normal mode, the file main.txt becomes to the original 
> state, that is
> 
> 
> 
> ---- main.txt ----
> 
> this is the main text
> 
> \include{snippet.txt}
> 
> 
> 
> Cheers,
> 
> Javier

I read more carefully tim response, because I didn't get the first time. Folds 
could be a point buy I prefer that the action to be managed by vim so I don't 
have to care about that.

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to