Loading ...
Sorry, an error occurred while loading the content.

Re: folding: some questions and comments (long)

Expand Messages
  • Mario Schweigler
    ... I do it differently in my script (soon available): I first thought of doing it like you described, but it seemed too messy and too dangerous to me. Now I
    Message 1 of 5 , Jul 1, 2002
    • 0 Attachment
      > > >You could write a script that yanks the text, opens a new window
      > > >and puts it there, putting back the changed text when you close the
      > > >window. It's a bit tricky, but should work.
      > >
      > > Sounds messy. It really needs to work in the same window.
      >
      > Something like this should work:
      >
      > yank the text in the fold, remember the line numbers
      > :hide enew
      > put the text
      >
      > [... do your edits ...]
      >
      > yank all the text
      > :buf! <previous buffer>
      > put the edited text in place of the remembered lines
      >
      > The tricky part is that the original buffer must not be edited in
      > another way in between, the line numbers could be messed up.

      I do it differently in my script (soon available): I first thought of
      doing it like you described, but it seemed too messy and too dangerous
      to me. Now I "simply" (it ain't that simple, but it is very stable) put
      the text before and after the folds in special swap files and remove it
      from the buffer so that just the fold will be left. Then I shift it to
      the left so that the indent is 0. (Just as origami does.) Exiting a fold
      works exactly the other way round.

      This way, even if vim crashes, we can still recover the text from the
      swap files, and this is something which is very important for me.

      Please be a bit patient, by the end of the week it will be available.

      > > I'm a bit puzzled by this foldtext option, surely because I don't
      > > know enough about vim and setting options. Even when I set foldtext
      > > to "" I still seem get a line full of dashes and the number of lines
      > > as info.
      >
      > I'm sure someone on the vim list can help you with this.

      OK, Paul: I can send you the famous 3 dots even now, as this is already
      finished and it doesn't affect the other stuff. Add the content of the
      attached file to a configuration file (.vimrc should do it for now,
      later on you should think of putting your own configuration stuff into
      separate *.vim files and calling them from .vimrc).

      Mario
    Your message has been successfully submitted and would be delivered to recipients shortly.