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

Vim and M$ Word

Expand Messages
  • David Morris
    Ok, I had a wild idea for vim, and as it would most likely require at least a few modifications to the vim source code, I thought I would run it by the list.
    Message 1 of 6 , Oct 8, 2002
      Ok, I had a wild idea for vim, and as it would most likely require at
      least a few modifications to the vim source code, I thought I would
      run it by the list.

      At work, we are forced to produce all documents using M$ Word. I
      don't mind this standard (though I don't like it), but there are many
      times when working with the WYSIWYG interface slows my productivity to
      a crawl...Word simply cannot be used as fast as I work (as opposed to
      vim, which goes faster than I).

      To get around this, I have sometimes written documents in html and
      imported them, or used a custom markup language and COM objects to
      generate the word doc. None of these solutions is all that great, it
      simply bypasses a portion of the awkwardness.

      But...what if VIM could be linked direclty to Word to act as a sort of
      "console" program? Type in a letter in VIM, and it appears in the
      word document. Type "<Ctrl>-B", and bold is turned on for the next
      characters, again to turn it off. You get the idea. At a simple
      level, replace (:s and :g commands) are out, but these should (at a
      conceptual level at least) be possible to implement as well at least
      to a limited extent. The possibility here is to give the a large
      portion of the power of VIM into a front-end to generating Word documents.

      Anyone ever considered such a wild and foolish project, or have any
      ideas of the scope of such a task? The actual connection to Word
      would be easy using COM objects (possibly run through the python
      scripting interface?).

      Comments on the idea? Any interest for such a (halfway revolting)
      creature asside from my own perverse self?

      --David

      --
      "I might not agree with what you say,
      but I will defend to the death your right to say it!"
      --Voltaire
    • Steve Hall
      David, Is this an issue of file inter-changability? Why not just cut/paste from Vim into Word? (I do.) Do you need the formatting? Then why use a text editor?
      Message 2 of 6 , Oct 8, 2002
        David,

        Is this an issue of file inter-changability? Why not just cut/paste
        from Vim into Word? (I do.) Do you need the formatting? Then why use
        a text editor? Is it because of the raw text editing power of Vim? Is
        Vim really better than Word at creating typeset(ish) paragraphs? (I
        know, sacrilege on this list. ;)

        The most interesting part of your problem to me is that of file
        format inter-changability. What if you found a way to create RTFs from
        Vim? This would keep things ASCII, and also play off of Word's
        habit of assuming that RTF == DOC.

        The HTML/PDF/LaTeX angle would be equally interesting from Vim, but
        don't we come back to why those formats have preference over ASCII in
        some cases? PHP can generate PDFs, RTFs, even images from raw ASCII.
        But are any of these methods a better tool than Word for what you're
        trying to do?

        I'm not arguing necessarily for Word, but word processors do have
        their place. As much as I like HTML and Vim, sometimes at work a quick
        Word doc makes sense in a collaborative effort with colleagues that
        have nary a clue about text editors. (I'm not remotely in CS.)

        Or perhaps you're talking about something completely different.
        Anyway, I'd be interested in some cool auto-translating button that
        could wisk my text file into a Word document and vice-versa. But to my
        thinking, this seems a problem of file format, not interface. At some
        point, the markup becomes so cumbersome you need another tool; we're
        somewhere between Vim/cut/paste and Word, right?


        Steve Hall [ digitect@... ]



        From: "David Morris" <lists@...>
        >
        > Ok, I had a wild idea for vim, and as it would most likely require at
        > least a few modifications to the vim source code, I thought I would
        > run it by the list.
        >
        > At work, we are forced to produce all documents using M$ Word. I
        > don't mind this standard (though I don't like it), but there are many
        > times when working with the WYSIWYG interface slows my productivity to
        > a crawl...Word simply cannot be used as fast as I work (as opposed to
        > vim, which goes faster than I).
        >
        > To get around this, I have sometimes written documents in html and
        > imported them, or used a custom markup language and COM objects to
        > generate the word doc. None of these solutions is all that great, it
        > simply bypasses a portion of the awkwardness.
        >
        > But...what if VIM could be linked direclty to Word to act as a sort of
        > "console" program? Type in a letter in VIM, and it appears in the
        > word document. Type "<Ctrl>-B", and bold is turned on for the next
        > characters, again to turn it off. You get the idea. At a simple
        > level, replace (:s and :g commands) are out, but these should (at a
        > conceptual level at least) be possible to implement as well at least
        > to a limited extent. The possibility here is to give the a large
        > portion of the power of VIM into a front-end to generating Word documents.
        >
        > Anyone ever considered such a wild and foolish project, or have any
        > ideas of the scope of such a task? The actual connection to Word
        > would be easy using COM objects (possibly run through the python
        > scripting interface?).
        >
        > Comments on the idea? Any interest for such a (halfway revolting)
        > creature asside from my own perverse self?
        >
        > --David
        >
        > --
        > "I might not agree with what you say,
        > but I will defend to the death your right to say it!"
        > --Voltaire
      • David Morris
        ... The whole type-setting issue is a very important one....creating the document should really be a different process from the typesetting process, which is
        Message 3 of 6 , Oct 8, 2002
          On Tue, Oct 08, 2002 at 10:15:14PM -0400, Steve Hall wrote:
          >
          > David,
          >
          > Is this an issue of file inter-changability? Why not just cut/paste
          > from Vim into Word? (I do.) Do you need the formatting? Then why use
          > a text editor? Is it because of the raw text editing power of Vim? Is
          > Vim really better than Word at creating typeset(ish) paragraphs? (I
          > know, sacrilege on this list. ;)

          The whole type-setting issue is a very important
          one....creating the document should really be a different
          process from the typesetting process, which is why I can
          create a document on the order of 100 times faster using VIM
          and LaTeX/HTML/XML/whatever, than I can using word.

          Consider, though, if one could punt off the job of
          typesetting a document to word, but keep the actual text
          entering step in VIM...with no messy import step in the
          middle that must be cleaned up in a time-consuming and
          imperfect manner.

          With VIM connected to Word, most of the document could
          probably map directly to the text file on a one-to-one
          basis. Those parts that don't, could probably be handled
          using some clever scheme of which I have a few ideas. As
          you are typing, you could, for instance, type "<Ctrl>-B",
          and the text in word would then be bold, again and bold is
          turned off. At the same time, you can use folding to
          compress sections you don't need to see at the moment,
          quickly navigate the document, and all those other tricks we
          love VIM for.

          And all the while, you have a window next to the text editor
          showing precisely what the created document looks like.

          I don't know about anyone else on this list, but in an
          environment where I am forced to create many Word documents,
          I really think this could be a huge time saver, not to
          mention a rather large savings on my sanity!

          Of course, it might all be far more work than it is worth in
          the end, especially if I am the only one who considers this
          an interesting idea. The real solution is to move away from
          WYSIWYG editors, but corporations (and John Doe, your
          average user), distinctly do not like that idea.

          --David
        • Vince Negri
          ... Some thoughts: 1) What happens when Word does some auto-formatting with the text Vim pokes in? How is Vim made aware of what word is doing behind its back?
          Message 4 of 6 , Oct 9, 2002
            > With VIM connected to Word, most of the document could
            > probably map directly to the text file on a one-to-one
            > basis. Those parts that don't, could probably be handled
            > using some clever scheme of which I have a few ideas.

            Some thoughts:

            1) What happens when Word does some auto-formatting
            with the text Vim pokes in? How is Vim made aware
            of what word is doing behind its back?

            2) Controlling Word via COM is not fast. (I've had
            to use this approach once.) You could end up with
            Word dragging Vim down to its speed.

            3) I have the nasty feeling that the two windows
            would always end up drifting out of sync. Imagine
            doing word-based cut and paste in Vim, while Word is
            inserting and removing inter-word space intelligently.

            4) You might end up having to disallow so many Vim
            features that you no longer get the productivity
            boost you seek.

            My impression is that this idea would only be workable
            if one could get much tighter integration with the
            word processor e.g. by working with the OpenOffice.org
            code base, where there is a nascent project on adding
            a WordPerfect-style "reveal codes window". Imagine
            having a reveal codes window which was also an
            embedded Vim window!! :-)~~~~~~~


            Vince
            Legal Disclaimer: Any views expressed by the sender of this message are
            not necessarily those of Application Solutions Ltd. Information in this
            e-mail may be confidential and is for the use of the intended recipient
            only, no mistake in transmission is intended to waive or compromise such
            privilege. Please advise the sender if you receive this e-mail by mistake.
          • David Brown
            ... At my place of employment, at 1/2 hour conversation with the head of tech pubs made them realize that it is much better for me to write documents in either
            Message 5 of 6 , Oct 9, 2002
              On Tue, Oct 08, 2002 at 11:39:06PM -0600, David Morris wrote:

              > The whole type-setting issue is a very important
              > one....creating the document should really be a different
              > process from the typesetting process, which is why I can
              > create a document on the order of 100 times faster using VIM
              > and LaTeX/HTML/XML/whatever, than I can using word.

              At my place of employment, at 1/2 hour conversation with the head of
              tech pubs made them realize that it is much better for me to write
              documents in either raw text, or HTML (using VIM) and just give them to
              tech pubs to format. I don't ever run word.

              It is nice to know that I'm not alone in being unable to formulate
              thoughts without a decent editor. I find programs like word
              frustrating, because I haven't the foggiest idea how to ask it to do
              things like swap sentences.

              Even the formatting I just leave up to the editor, since they can do it
              about 40 times faster than me.

              As far as vim-like editing, you probably would be best making your own
              very involved set of macros in Word. Or, use some type of tags (such as
              sgml or xml) that match to the formatting that word is using, and use
              your com solutions to move the data over.

              Dave Brown
            • David Morris
              As for word auto-formatting, I have long since figured out how to turn off all such word annoyances...some I simply don t ever want (auto-styles), and others I
              Message 6 of 6 , Oct 9, 2002
                As for word auto-formatting, I have long since figured out how to turn
                off all such word annoyances...some I simply don't ever want
                (auto-styles), and others I need off for specific tasks. I am fairly
                certain I could keep the two programs in sync. I had considered the
                fact that the scope of the project could be very large indeed if I
                allow the best features of VIM, but I had not thought of how slow COM
                objects are...I think you are right (unfortunately) that the
                everything would run far too slow.

                Oh well, it was an interesting thought. Perhaps someday I'll work
                with OpenOffice on a similar solution....

                --David

                --
                "I might not agree with what you say,
                but I will defend to the death your right to say it!"
                --Voltaire


                Quoting Vince Negri <vnegri@...>:

                >
                > > With VIM connected to Word, most of the document could
                > > probably map directly to the text file on a one-to-one
                > > basis. Those parts that don't, could probably be handled
                > > using some clever scheme of which I have a few ideas.
                >
                > Some thoughts:
                >
                > 1) What happens when Word does some auto-formatting
                > with the text Vim pokes in? How is Vim made aware
                > of what word is doing behind its back?
                >
                > 2) Controlling Word via COM is not fast. (I've had
                > to use this approach once.) You could end up with
                > Word dragging Vim down to its speed.
                >
                > 3) I have the nasty feeling that the two windows
                > would always end up drifting out of sync. Imagine
                > doing word-based cut and paste in Vim, while Word is
                > inserting and removing inter-word space intelligently.
                >
                > 4) You might end up having to disallow so many Vim
                > features that you no longer get the productivity
                > boost you seek.
                >
                > My impression is that this idea would only be workable
                > if one could get much tighter integration with the
                > word processor e.g. by working with the OpenOffice.org
                > code base, where there is a nascent project on adding
                > a WordPerfect-style "reveal codes window". Imagine
                > having a reveal codes window which was also an
                > embedded Vim window!! :-)~~~~~~~
                >
                >
                > Vince
                > Legal Disclaimer: Any views expressed by the sender of this message
                > are
                > not necessarily those of Application Solutions Ltd. Information in
                > this
                > e-mail may be confidential and is for the use of the intended
                > recipient
                > only, no mistake in transmission is intended to waive or compromise
                > such
                > privilege. Please advise the sender if you receive this e-mail by
                > mistake.
                >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.