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

VIM and TCL

Expand Messages
  • Stephen Morley
    Is anyone using VIM to edit TCL files? Especially in AOLServer! My biggest problem is that we have some very long SQL statements or HTML blocks which throw off
    Message 1 of 6 , Jan 17, 2001
    View Source
    • 0 Attachment
      Is anyone using VIM to edit TCL files? Especially in AOLServer!

      My biggest problem is that we have some very long SQL statements or HTML
      blocks which throw off the parser. I have tried setting minlines to
      something large, but when I set it to 500 (which makes the syntax work) it
      make editing VERY slow. So are there any ideas on how to make this work
      better?

      Stephen
    • ppp
      Hi, I just started using TCL on a Windows platform. Currently, I use VIM to modify tcl files, then I have to go inside a tcl console (ActiveState) to source
      Message 2 of 6 , Oct 6, 2010
      View Source
      • 0 Attachment
        Hi,

        I just started using TCL on a Windows platform. Currently, I use VIM
        to
        modify tcl files, then I have to go inside a tcl console (ActiveState)
        to source the file and then execute a function.

        Is there a way to launch TCL script within VIM? Ideally, I want to
        split
        VIM into two planes, so that I can modify code on the left side and
        make
        the output show up on the right side.

        Thanks

        --
        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
      • Joan Miquel Torres Rigo
        ... Aside is difficult because vim isn t multithread (and not intended to be so). But I use a (for me) wonderful trick with screen. This is not yet finished
        Message 3 of 6 , Oct 6, 2010
        View Source
        • 0 Attachment
          2010/10/6 ppp <phoenixyuan@...>:
          >   Hi,
          >
          > I just started using TCL on a Windows platform. Currently, I use VIM
          > to
          > modify tcl files, then I have to go inside a tcl console (ActiveState)
          > to source the file and then execute a function.
          >
          > Is there a way to launch TCL script within VIM? Ideally, I want to
          > split
          > VIM into two planes, so that I can modify code on the left side and
          > make
          > the output show up on the right side.

          Aside is difficult because vim isn't multithread (and not intended to be so).

          But I use a (for me) wonderful trick with screen.

          This is not yet finished yet (you must remember to exit sessions
          before exiting vim (or kill/exit them manually before)) but works
          quite fine.

          This way I get a unique screen session which I can access/leave any
          time by pressing F12 key.

          Below I paste what I have in my ~/.vimrc. Maybe could be useful for you:

          -8<--------------------------------------------------
          F12 -> Attached Screen session: {{{
          " ==============================
          " cd $(dirname %:p) --> Change to current file's directory.
          " screen
          " -U -> Run in UTF-8 mode.
          " -d -> Deatach if previously attached.
          " -dRR vim_$(basename %:p)
          " -> Use current buffer file name as sessionname; then
          reattach it and, if necessary, detach or create it first. Use the
          first session if more than one session with same name are available.
          " -e^qa -> Change default screen's escape key to CTRL-Q to
          avoid conflict if vim itself is running in other screen session.
          " -p %:p -> Use current buffer file full path as preselected
          (if available) window.
          " * TODO: Create this window by default when not exists.
          "noremap <f12> :silent<space>!bash<space>-c<space>'cd<space>$(dirname<space>%:p);screen<space>-UdRR<space>vim_$(basename<space>%:p)<space>-e^qa<space>-p<space>"%:p"<space>-c<space>~/.vim/screenrc'<enter>:redraw!<enter>
          noremap <f12> :silent<space>!bash<space>-c<space>'cd<space>$(dirname<space>%:p);screen<space>-UdRR<space>vim_${PPID}<space>-e^qa<space>-p<space>"%"<space>-c<space>~/.vim/screenrc'<enter>:redraw!<enter>

          "Auto-terminate screen on exitting
          "(Testing in progress...)
          "autocmd VimLeave * !kill $(screen -ls | grep vim_{$PPID} | perl -pe
          's/.*?(\d+).*/\1/') 2> /dev/null
          "autocmd VimLeave * !echo $(screen -ls vim_${PPID} | perl -pe
          's/^.*?(\d+).*$/\1/') > ~/vimleave.txt

          "autocmd VimLeave * 'echo $(screen -ls | grep ${PPID} ) > ~/vimleave.txt'
          "autocmd VimLeave * !echo Manolo > ~/vimleave.txt


          " Prepare vim's screen configuration:
          " ----------------------------------
          " Create ~/.vim directory if not already exists.
          silent !mkdir -p ~/.vim
          " Copy user's ~/.screenrc if exists.
          silent !cp ~/.screenrc ~/.vim/screenrc 2>/dev/null
          " Bind F12 to 'detach' command in screen.
          silent !echo 'bindkey -k F2 detach' >> ~/.vim/screenrc
          " }}}
          -8<--------------------------------------------------



          --
          Joan Miquel Torres__________________________________
          Linux Registered User #164872
          http://www.mallorcaweb.net/joanmiquel
          BULMA: http://bulma.net http://breu.bulma.net/?l2301

          --
          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
        • Marc Weber
          Hi ppp Your options: - implement windows version of this patch http://github.com/bartman/vim.git (which still can be improved a lot) and make it it poll file
          Message 4 of 6 , Oct 6, 2010
          View Source
          • 0 Attachment
            Hi ppp

            Your options:
            - implement windows version of this patch
            http://github.com/bartman/vim.git (which still can be improved a lot)
            and make it it poll file handlers when not typing. Implement a shell
            like interface.

            - There is a patch which let's you start a shell in Vim. I don't think
            it got updated (which is linux only)
            http://www.wana.at/vimshell/
            (Maybe cygwin or such ?) - I never tried it.

            - vimshell (www.vim.org). You have to get a dell or such. I think this
            could satisfy you.
            (vcs: http://github.com/Shougo/vimshell)

            - screen (see other mail)
            c-a S splits the window
            c-a tab switches focus

            if you run interpreter this way: tcl | tee log

            you may have a chance getting errors into quickfix or such

            (requires cygwin or such - I never tried it on Windows ?)

            use Emacs and vimpulse (I hate to say it)


            Or switch your mind:
            Don't try to run the interpreter. Run small scripts instead and bind
            running it to a key.

            That's all I know about.


            I'd start with vimshell - Good luck

            Marc Weber

            --
            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
          • Charles E Campbell Jr
            ... Perhaps RunView will help with this: http://mysite.verizon.net/astronaut/vim/index.html#RUNVIEW You ll need to have the following line in your .vimrc: let
            Message 5 of 6 , Oct 6, 2010
            View Source
            • 0 Attachment
              ppp wrote:
              > Hi,
              >
              > I just started using TCL on a Windows platform. Currently, I use VIM
              > to
              > modify tcl files, then I have to go inside a tcl console (ActiveState)
              > to source the file and then execute a function.
              >
              > Is there a way to launch TCL script within VIM? Ideally, I want to
              > split
              > VIM into two planes, so that I can modify code on the left side and
              > make
              > the output show up on the right side.
              >

              Perhaps RunView will help with this:
              http://mysite.verizon.net/astronaut/vim/index.html#RUNVIEW

              You'll need to have the following line in your .vimrc:

              let g:runview_filtcmd="tcl"

              although it'd be better to have

              au FileType tcl let g:runview_filtcmd="tcl"

              I admit that I'm guessing that, while in the shell,
              tcl somefile
              will launch tcl script.

              Then,

              vim somefile (assuming its a tcl/tk file)
              :RV

              will run the file with tcl and put the output in a separate window.

              Regards,
              Chip Campbell


              --
              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
            • sc
              On Wednesday 06 October 2010 16:10:50 Charles E Campbell Jr ... actually it s tclsh , but tcl folks will know that sc -- You received this message from the
              Message 6 of 6 , Oct 6, 2010
              View Source
              • 0 Attachment
                On Wednesday 06 October 2010 16:10:50 Charles E Campbell Jr
                wrote:

                > I admit that I'm guessing that, while in the shell,
                > tcl somefile
                > will launch tcl script.

                actually it's 'tclsh', but tcl folks will know that

                sc

                --
                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
              Your message has been successfully submitted and would be delivered to recipients shortly.