ConTeXt: Use of t-vim module in table

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite












How can use the t-vim module inside a TABLE environment?



I know it propably has something to do with buffers but I'm not sure how to store the output from vim into a buffer.



MWE:



usemodule[vim]

definevimtyping
[somecode]
[lines=split]

starttext
typebuffer[visit]

bTABLE
bTR
bTD
startsomecode
test code
stopsomecode
eTD
eTR
eTABLE
stoptext









share|improve this question

















  • 1




    I realized that process<vim>buffer was not documented, so I added it to the documentation at github
    – Aditya
    Nov 27 at 16:44














up vote
6
down vote

favorite












How can use the t-vim module inside a TABLE environment?



I know it propably has something to do with buffers but I'm not sure how to store the output from vim into a buffer.



MWE:



usemodule[vim]

definevimtyping
[somecode]
[lines=split]

starttext
typebuffer[visit]

bTABLE
bTR
bTD
startsomecode
test code
stopsomecode
eTD
eTR
eTABLE
stoptext









share|improve this question

















  • 1




    I realized that process<vim>buffer was not documented, so I added it to the documentation at github
    – Aditya
    Nov 27 at 16:44












up vote
6
down vote

favorite









up vote
6
down vote

favorite











How can use the t-vim module inside a TABLE environment?



I know it propably has something to do with buffers but I'm not sure how to store the output from vim into a buffer.



MWE:



usemodule[vim]

definevimtyping
[somecode]
[lines=split]

starttext
typebuffer[visit]

bTABLE
bTR
bTD
startsomecode
test code
stopsomecode
eTD
eTR
eTABLE
stoptext









share|improve this question













How can use the t-vim module inside a TABLE environment?



I know it propably has something to do with buffers but I'm not sure how to store the output from vim into a buffer.



MWE:



usemodule[vim]

definevimtyping
[somecode]
[lines=split]

starttext
typebuffer[visit]

bTABLE
bTR
bTD
startsomecode
test code
stopsomecode
eTD
eTR
eTABLE
stoptext






context






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 27 at 14:10









Christopher Bock

895




895







  • 1




    I realized that process<vim>buffer was not documented, so I added it to the documentation at github
    – Aditya
    Nov 27 at 16:44












  • 1




    I realized that process<vim>buffer was not documented, so I added it to the documentation at github
    – Aditya
    Nov 27 at 16:44







1




1




I realized that process<vim>buffer was not documented, so I added it to the documentation at github
– Aditya
Nov 27 at 16:44




I realized that process<vim>buffer was not documented, so I added it to the documentation at github
– Aditya
Nov 27 at 16:44










2 Answers
2






active

oldest

votes

















up vote
6
down vote



accepted










Since t-vim is built on top of t-filter, you can can use the process<filter>buffer command to load an existing buffer:



usemodule[vim]

definevimtyping
[somecode]
[lines=split]

definevimtyping
[RUBY]
[syntax=ruby]

starttext

startbuffer[ruby]
# Ruby program listing
print("Hello World")
stopbuffer

startbuffer[somecode]
test code
more lines
stopbuffer

bTABLE
bTR
bTD
processsomecodebuffer[somecode]
eTD
bTD
processRUBYbuffer[ruby]
eTD
eTR
eTABLE

stoptext


You could alternatively use the module ntb-to-xtb, which lets you use xtables with natural table syntax (in other words: this lets you use TeXnicians solution without changing the code):



usemodule[vim]
usemodule[ntb-to-xtb]

definevimtyping
[somecode]
[lines=split]

definevimtyping
[RUBY]
[syntax=ruby]

starttext

bTABLE
bTR
bTD
startsomecode
test code
more lines
stopsomecode
eTD
bTD
startRUBY
# Ruby program listing
print("Hello World")
stopRUBY
eTD
eTR
eTABLE

stoptext


The output for both solutions is the same:



enter image description here






share|improve this answer





























    up vote
    5
    down vote













    More of a comment than an answer: With xtables you may use verbatim material directly.



    usemodule[vim]

    definevimtyping
    [somecode]
    [lines=split]

    starttext
    typebuffer[visit]

    startxtable
    startxrow
    startxcell
    startsomecode
    test code
    stopsomecode
    stopxcell
    stopxrow
    stopxtable
    stoptext





    share|improve this answer




















    • I had to move away from xtables because I encountered problems with them... tex.stackexchange.com/questions/460142/… and mailman.ntg.nl/pipermail/ntg-context/2018/093357.html
      – Christopher Bock
      Nov 28 at 10:21






    • 1




      @ChristopherBock Ah, okay. Then this answer is just for future readers who might not have problems with xtables.
      – TeXnician
      Nov 28 at 10:22










    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462001%2fcontext-use-of-t-vim-module-in-table%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    6
    down vote



    accepted










    Since t-vim is built on top of t-filter, you can can use the process<filter>buffer command to load an existing buffer:



    usemodule[vim]

    definevimtyping
    [somecode]
    [lines=split]

    definevimtyping
    [RUBY]
    [syntax=ruby]

    starttext

    startbuffer[ruby]
    # Ruby program listing
    print("Hello World")
    stopbuffer

    startbuffer[somecode]
    test code
    more lines
    stopbuffer

    bTABLE
    bTR
    bTD
    processsomecodebuffer[somecode]
    eTD
    bTD
    processRUBYbuffer[ruby]
    eTD
    eTR
    eTABLE

    stoptext


    You could alternatively use the module ntb-to-xtb, which lets you use xtables with natural table syntax (in other words: this lets you use TeXnicians solution without changing the code):



    usemodule[vim]
    usemodule[ntb-to-xtb]

    definevimtyping
    [somecode]
    [lines=split]

    definevimtyping
    [RUBY]
    [syntax=ruby]

    starttext

    bTABLE
    bTR
    bTD
    startsomecode
    test code
    more lines
    stopsomecode
    eTD
    bTD
    startRUBY
    # Ruby program listing
    print("Hello World")
    stopRUBY
    eTD
    eTR
    eTABLE

    stoptext


    The output for both solutions is the same:



    enter image description here






    share|improve this answer


























      up vote
      6
      down vote



      accepted










      Since t-vim is built on top of t-filter, you can can use the process<filter>buffer command to load an existing buffer:



      usemodule[vim]

      definevimtyping
      [somecode]
      [lines=split]

      definevimtyping
      [RUBY]
      [syntax=ruby]

      starttext

      startbuffer[ruby]
      # Ruby program listing
      print("Hello World")
      stopbuffer

      startbuffer[somecode]
      test code
      more lines
      stopbuffer

      bTABLE
      bTR
      bTD
      processsomecodebuffer[somecode]
      eTD
      bTD
      processRUBYbuffer[ruby]
      eTD
      eTR
      eTABLE

      stoptext


      You could alternatively use the module ntb-to-xtb, which lets you use xtables with natural table syntax (in other words: this lets you use TeXnicians solution without changing the code):



      usemodule[vim]
      usemodule[ntb-to-xtb]

      definevimtyping
      [somecode]
      [lines=split]

      definevimtyping
      [RUBY]
      [syntax=ruby]

      starttext

      bTABLE
      bTR
      bTD
      startsomecode
      test code
      more lines
      stopsomecode
      eTD
      bTD
      startRUBY
      # Ruby program listing
      print("Hello World")
      stopRUBY
      eTD
      eTR
      eTABLE

      stoptext


      The output for both solutions is the same:



      enter image description here






      share|improve this answer
























        up vote
        6
        down vote



        accepted







        up vote
        6
        down vote



        accepted






        Since t-vim is built on top of t-filter, you can can use the process<filter>buffer command to load an existing buffer:



        usemodule[vim]

        definevimtyping
        [somecode]
        [lines=split]

        definevimtyping
        [RUBY]
        [syntax=ruby]

        starttext

        startbuffer[ruby]
        # Ruby program listing
        print("Hello World")
        stopbuffer

        startbuffer[somecode]
        test code
        more lines
        stopbuffer

        bTABLE
        bTR
        bTD
        processsomecodebuffer[somecode]
        eTD
        bTD
        processRUBYbuffer[ruby]
        eTD
        eTR
        eTABLE

        stoptext


        You could alternatively use the module ntb-to-xtb, which lets you use xtables with natural table syntax (in other words: this lets you use TeXnicians solution without changing the code):



        usemodule[vim]
        usemodule[ntb-to-xtb]

        definevimtyping
        [somecode]
        [lines=split]

        definevimtyping
        [RUBY]
        [syntax=ruby]

        starttext

        bTABLE
        bTR
        bTD
        startsomecode
        test code
        more lines
        stopsomecode
        eTD
        bTD
        startRUBY
        # Ruby program listing
        print("Hello World")
        stopRUBY
        eTD
        eTR
        eTABLE

        stoptext


        The output for both solutions is the same:



        enter image description here






        share|improve this answer














        Since t-vim is built on top of t-filter, you can can use the process<filter>buffer command to load an existing buffer:



        usemodule[vim]

        definevimtyping
        [somecode]
        [lines=split]

        definevimtyping
        [RUBY]
        [syntax=ruby]

        starttext

        startbuffer[ruby]
        # Ruby program listing
        print("Hello World")
        stopbuffer

        startbuffer[somecode]
        test code
        more lines
        stopbuffer

        bTABLE
        bTR
        bTD
        processsomecodebuffer[somecode]
        eTD
        bTD
        processRUBYbuffer[ruby]
        eTD
        eTR
        eTABLE

        stoptext


        You could alternatively use the module ntb-to-xtb, which lets you use xtables with natural table syntax (in other words: this lets you use TeXnicians solution without changing the code):



        usemodule[vim]
        usemodule[ntb-to-xtb]

        definevimtyping
        [somecode]
        [lines=split]

        definevimtyping
        [RUBY]
        [syntax=ruby]

        starttext

        bTABLE
        bTR
        bTD
        startsomecode
        test code
        more lines
        stopsomecode
        eTD
        bTD
        startRUBY
        # Ruby program listing
        print("Hello World")
        stopRUBY
        eTD
        eTR
        eTABLE

        stoptext


        The output for both solutions is the same:



        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 28 at 9:52

























        answered Nov 27 at 16:09









        DG'

        9,00511740




        9,00511740




















            up vote
            5
            down vote













            More of a comment than an answer: With xtables you may use verbatim material directly.



            usemodule[vim]

            definevimtyping
            [somecode]
            [lines=split]

            starttext
            typebuffer[visit]

            startxtable
            startxrow
            startxcell
            startsomecode
            test code
            stopsomecode
            stopxcell
            stopxrow
            stopxtable
            stoptext





            share|improve this answer




















            • I had to move away from xtables because I encountered problems with them... tex.stackexchange.com/questions/460142/… and mailman.ntg.nl/pipermail/ntg-context/2018/093357.html
              – Christopher Bock
              Nov 28 at 10:21






            • 1




              @ChristopherBock Ah, okay. Then this answer is just for future readers who might not have problems with xtables.
              – TeXnician
              Nov 28 at 10:22














            up vote
            5
            down vote













            More of a comment than an answer: With xtables you may use verbatim material directly.



            usemodule[vim]

            definevimtyping
            [somecode]
            [lines=split]

            starttext
            typebuffer[visit]

            startxtable
            startxrow
            startxcell
            startsomecode
            test code
            stopsomecode
            stopxcell
            stopxrow
            stopxtable
            stoptext





            share|improve this answer




















            • I had to move away from xtables because I encountered problems with them... tex.stackexchange.com/questions/460142/… and mailman.ntg.nl/pipermail/ntg-context/2018/093357.html
              – Christopher Bock
              Nov 28 at 10:21






            • 1




              @ChristopherBock Ah, okay. Then this answer is just for future readers who might not have problems with xtables.
              – TeXnician
              Nov 28 at 10:22












            up vote
            5
            down vote










            up vote
            5
            down vote









            More of a comment than an answer: With xtables you may use verbatim material directly.



            usemodule[vim]

            definevimtyping
            [somecode]
            [lines=split]

            starttext
            typebuffer[visit]

            startxtable
            startxrow
            startxcell
            startsomecode
            test code
            stopsomecode
            stopxcell
            stopxrow
            stopxtable
            stoptext





            share|improve this answer












            More of a comment than an answer: With xtables you may use verbatim material directly.



            usemodule[vim]

            definevimtyping
            [somecode]
            [lines=split]

            starttext
            typebuffer[visit]

            startxtable
            startxrow
            startxcell
            startsomecode
            test code
            stopsomecode
            stopxcell
            stopxrow
            stopxtable
            stoptext






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 27 at 16:09









            TeXnician

            23.7k62984




            23.7k62984











            • I had to move away from xtables because I encountered problems with them... tex.stackexchange.com/questions/460142/… and mailman.ntg.nl/pipermail/ntg-context/2018/093357.html
              – Christopher Bock
              Nov 28 at 10:21






            • 1




              @ChristopherBock Ah, okay. Then this answer is just for future readers who might not have problems with xtables.
              – TeXnician
              Nov 28 at 10:22
















            • I had to move away from xtables because I encountered problems with them... tex.stackexchange.com/questions/460142/… and mailman.ntg.nl/pipermail/ntg-context/2018/093357.html
              – Christopher Bock
              Nov 28 at 10:21






            • 1




              @ChristopherBock Ah, okay. Then this answer is just for future readers who might not have problems with xtables.
              – TeXnician
              Nov 28 at 10:22















            I had to move away from xtables because I encountered problems with them... tex.stackexchange.com/questions/460142/… and mailman.ntg.nl/pipermail/ntg-context/2018/093357.html
            – Christopher Bock
            Nov 28 at 10:21




            I had to move away from xtables because I encountered problems with them... tex.stackexchange.com/questions/460142/… and mailman.ntg.nl/pipermail/ntg-context/2018/093357.html
            – Christopher Bock
            Nov 28 at 10:21




            1




            1




            @ChristopherBock Ah, okay. Then this answer is just for future readers who might not have problems with xtables.
            – TeXnician
            Nov 28 at 10:22




            @ChristopherBock Ah, okay. Then this answer is just for future readers who might not have problems with xtables.
            – TeXnician
            Nov 28 at 10:22

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f462001%2fcontext-use-of-t-vim-module-in-table%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay