How to keep folds intact when the file is sent over mail

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to keep folds intact when the file is sent over mail

sheetal
Hello All,

I don't konw if this is possible, but i've a text file on which i've applied fold cmd using the marks, Now when i send the file to over email, I want to keep the fold intact so that the other person viewing the file should also see the folds, Current behaviour is the person viewing the file will see all the fold extended and also if we try fold using 'zc' Error saying fold not defined pops up.
Any pointers on this would be appreciated.

Thank you.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: How to keep folds intact when the file is sent over mail

Tim Chase
On 2013-03-21 00:15, sheetal wrote:
> I don't konw if this is possible, but i've a text file on which
> i've applied fold cmd using the marks, Now when i send the file to
> over email, I want to keep the fold intact so that the other person
> viewing the file should also see the folds, Current behaviour is
> the person viewing the file will see all the fold extended and also
> if we try fold using 'zc' Error saying fold not defined pops up.
> Any pointers on this would be appreciated.

You'd need to coordinate your configurations.  You say that you're
using "marks", which I presume means you're using fold markers
(":set foldmethod=marker", note that you might have to also change
'commentstring' to something appropriate for the language you're
using) rather than "set foldmethod=manual".

According to

  :help fold-marker

you can manually specify the fold-level after the markers. You can
then have the other person set the fold-method to "marker" and then
use "zM" to close all the folds you want closed.  This gets pretty
close to what you want, though it breaks down if you want to send
folds that don't get closed.

-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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: How to keep folds intact when the file is sent over mail

Christian Brabandt
Hi Tim!

On Do, 21 Mär 2013, Tim Chase wrote:

> On 2013-03-21 00:15, sheetal wrote:
> > I don't konw if this is possible, but i've a text file on which
> > i've applied fold cmd using the marks, Now when i send the file to
> > over email, I want to keep the fold intact so that the other person
> > viewing the file should also see the folds, Current behaviour is
> > the person viewing the file will see all the fold extended and also
> > if we try fold using 'zc' Error saying fold not defined pops up.
> > Any pointers on this would be appreciated.
>
> You'd need to coordinate your configurations.  You say that you're
> using "marks", which I presume means you're using fold markers
> (":set foldmethod=marker", note that you might have to also change
> 'commentstring' to something appropriate for the language you're
> using) rather than "set foldmethod=manual".
>
> According to
>
>   :help fold-marker
>
> you can manually specify the fold-level after the markers. You can
> then have the other person set the fold-method to "marker" and then
> use "zM" to close all the folds you want closed.  This gets pretty
> close to what you want, though it breaks down if you want to send
> folds that don't get closed.

I am not exactly sure, since I have never used it,  but using :mkview
should create a script that when applied by the other user, he should be
able to view it exactly like the author did see it.

regards
Christian
--
Wie man sein Kind nicht nennen sollte:
  Axel Zucken

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: How to keep folds intact when the file is sent over mail

Benjamin Fritz
In reply to this post by sheetal
On Thursday, March 21, 2013 2:15:27 AM UTC-5, sheetal wrote:
> Hello All,
>
> I don't konw if this is possible, but i've a text file on which i've applied fold cmd using the marks, Now when i send the file to over email, I want to keep the fold intact so that the other person viewing the file should also see the folds, Current behaviour is the person viewing the file will see all the fold extended and also if we try fold using 'zc' Error saying fold not defined pops up.
> Any pointers on this would be appreciated.
>
> Thank you.

If you're just sending them something to view, but not really intending them to edit it, you can also use :TOhtml (especially with dynamic folding enabled) to create an HTML representation of your file including the fold information.

This is one of the things I actually use :TOhtml for, especially when I'm sharing with non-Vim users.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.