On 2013-08-17 02:18, Javier Mediavilla Vegas wrote:
> > ---- main.txt ----
> >
> > this is the main text
> >
> > \include{snippet.txt}
>
> 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.
The original post had mentioned refreshing when folds were opened, so
I assumed that you requested what you wanted. :-)
I'm not sure there's an easy way for Vim to do this automatically (at
least not without more overhead/testing than I'd be willing to give
up). However, one could make a "update all my includes" mapping.
Also note that you'd need to have markers bracketing both the start
*and the end* of the included text so that it could be removed and
replaced with new content. Otherwise, you'd not know where the
inserted text ended. Thus, I might map something like
:g/^\\include{.*}/+,/^% end include/-d|?\\include{.*}?|exec 'r
'.substitute(getline('.'), '\\include{\([^}]*\)}', '\1', '')
which finds everything from
\\include{filename.txt}
through a line starting with
% end include
(it looks like you're working in LaTeX, and a quick search suggests
that this is how you do a single-line comment).
Thus you could map a single key to update all the inclusions in your
file.
-tim
--
--
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.