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

Re: vim: help for scripting

Expand Messages
  • Ben Fritz
    ... You used a ! at the end of your command. See :help :normal. Using a ! says don t use any mappings . This is a rare case where you actually need to
    Message 1 of 15 , Feb 6, 2013
    • 0 Attachment
      On Wednesday, February 6, 2013 3:08:14 PM UTC-6, ping wrote:
      > it looks sth got break in it, at least followig doesn't work when I
      >
      > tested it manually:
      >
      >
      >
      > normal! <CR>
      >
      >
      >
      > I thought this is equivalent to hitting a return, which jumps to the
      >
      > other window , which is what will happen if I hit return myself in
      >
      > Voom

      You used a '!' at the end of your command. See :help :normal. Using a '!' says "don't use any mappings". This is a rare case where you actually need to leave it off.

      You might have another problem, because you get two window numbers, save them off, then try to jump to each in turn to close them.

      As soon as you close the first window, all the windows potentially get renumbered. You can pull it off by always jumping to and closing the largest numbered window number first.

      --
      --
      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 vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • ping
      ... thanks Ben and Marcin for pointing this out. I understood now that this is one of the scenario that I need to retain the origin mappings without ! in
      Message 2 of 15 , Feb 6, 2013
      • 0 Attachment
        On 02/06/2013 04:54 PM, Ben Fritz wrote:
        > On Wednesday, February 6, 2013 3:08:14 PM UTC-6, ping wrote:
        >> it looks sth got break in it, at least followig doesn't work when I
        >>
        >> tested it manually:
        >>
        >>
        >>
        >> normal! <CR>
        >>
        >>
        >>
        >> I thought this is equivalent to hitting a return, which jumps to the
        >>
        >> other window , which is what will happen if I hit return myself in
        >>
        >> Voom
        > You used a '!' at the end of your command. See :help :normal. Using a '!' says "don't use any mappings". This is a rare case where you actually need to leave it off.
        thanks Ben and Marcin for pointing this out.
        I understood now that this is one of the scenario that I need to retain
        the origin mappings without "!" in normal.
        but the problem here is, that <cr> to jump between 2 window apparently
        wasn't implemented via the regular vim map, but it comes with the Voom
        plugin , written in python. I guess that's why even without "!" it won't
        jump with "normal <CR>". it seems only work with a manual return hit...

        this makes me think that actually the vim 'normal' command is not
        actually reliably reproducing what we did manually in normal mode.
        so is that any good way to completely simulate a real "hit return"
        exactly as what will be triggered when doing it manually?

        >
        > You might have another problem, because you get two window numbers, save them off, then try to jump to each in turn to close them.
        yes this is what my idea was.
        >
        > As soon as you close the first window, all the windows potentially get renumbered.
        I really didn't know this...so its a dynamic numbering then..good to learn.
        > You can pull it off by always jumping to and closing the largest numbered window number first.
        good ideal. that part can be fixed based on this.

        function! QuitNR()
        let wn_curr=winnr()
        normal <CR>
        let wn_pair=winnr()
        let wn_larger=wn_curr > wn_pair ? wn_curr : wn_pair
        let wn_smaller=wn_curr < wn_pair ? wn_curr : wn_pair
        exec wn_larger . "wincmd w"
        close
        exec wn_smaller . "wincmd w"
        close
        endfu


        --
        --
        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 vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Marc Weber
        ... Do what I said: 1) use map to find out whether the mapping already exist when you run the code. 2) lookup how the the Voom plugin does map to a
        Message 3 of 15 , Feb 6, 2013
        • 0 Attachment
          > wasn't implemented via the regular vim map, but it comes with the Voom
          > plugin , written in python.
          Do what I said:
          1) use map <cr> to find out whether the mapping already
          exist when you run the code.
          2) lookup how the the Voom plugin does map <CR> to a key.
          There is no python magic - all mappings are done in Vim - so you're
          likely to be wrong about assuming its related to python.

          grep the plugin code for CR and cr and you'll be lucky. Then try using
          the right hand side instead of sendig <cr> - you may get more helpful
          error messages then.

          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

          ---
          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 vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Marcin Szamotulski
          ... I am not aware of the Voom plugin, but it may define buffer local maps. (see :help map- ). Regards, Marcin -- -- You received this message from
          Message 4 of 15 , Feb 6, 2013
          • 0 Attachment
            On 23:20 Wed 06 Feb , Marc Weber wrote:
            > > wasn't implemented via the regular vim map, but it comes with the Voom
            > > plugin , written in python.
            > Do what I said:
            > 1) use map <cr> to find out whether the mapping already
            > exist when you run the code.
            > 2) lookup how the the Voom plugin does map <CR> to a key.
            > There is no python magic - all mappings are done in Vim - so you're
            > likely to be wrong about assuming its related to python.
            >
            > grep the plugin code for CR and cr and you'll be lucky. Then try using
            > the right hand side instead of sendig <cr> - you may get more helpful
            > error messages then.
            >
            > 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
            >
            > ---
            > 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 vim_use+unsubscribe@....
            > For more options, visit https://groups.google.com/groups/opt_out.
            >

            I am not aware of the Voom plugin, but it may define buffer local maps.
            (see ':help map-<buffer>').

            Regards,
            Marcin

            --
            --
            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 vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • ping
            ... I got no mapping found ... I agree now that I m wrong on that. so I got these from the plugin code: Which key to map to
            Message 5 of 15 , Feb 6, 2013
            • 0 Attachment
              On 2/6/2013 5:39 PM, Marcin Szamotulski wrote:
              > 1) use map <cr> to find out whether the mapping already
              > >exist when you run the code.
              I got "no mapping found"
              > >2) lookup how the the Voom plugin does map <CR> to a key.
              > >There is no python magic - all mappings are done in Vim - so you're
              > >likely to be wrong about assuming its related to python.
              I agree now that I'm wrong on that.
              so I got these from the plugin code:

              " Which key to map to Select-Node-and-Shuttle-between-Body/Tree
              if !exists('g:voom_return_key')
              let g:voom_return_key = '<Return>'
              endif

              ......

              exe "nnoremap <buffer><silent> ".g:voom_return_key." :<C-u>call
              Voom_TreeSelect(0)<CR>"
              exe "vnoremap <buffer><silent> ".g:voom_return_key." <Esc>:<C-u>call
              Voom_TreeSelect(0)<CR>"
              "exe "vnoremap <buffer><silent> ".g:voom_return_key." <Nop>"
              exe "nnoremap <buffer><silent> ".g:voom_tab_key." :<C-u>call
              Voom_ToTreeOrBodyWin()<CR>"
              exe "vnoremap <buffer><silent> ".g:voom_tab_key." <Esc>:<C-u>call
              Voom_ToTreeOrBodyWin()<CR>"
              "exe "vnoremap <buffer><silent> ".g:voom_tab_key." <Nop>"

              > >
              > >grep the plugin code for CR and cr and you'll be lucky. Then try using
              > >the right hand side instead of sendig <cr> - you may get more helpful
              > >error messages then.
              this is a bit complex kind of map... so based on that , how can I make a
              jump within my script?
              I tried:
              exec "<C-u>call Voom_TreeSelect(0)<CR>"

              it seems not work:

              Error detected while processing function QuitNR:
              line 11:
              E488: Trailing characters: <C-u>call Voom_TreeSelect(0)<CR>
              Press ENTER or type command to continue


              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

              ---
              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 vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Marcin Szamotulski
              ... To call a function it is enough to write: call VoomTreeSelect(0) in you vimscript. However if you want to use :execute command (but you don t need to):
              Message 6 of 15 , Feb 7, 2013
              • 0 Attachment
                On 22:45 Wed 06 Feb , ping wrote:
                > On 2/6/2013 5:39 PM, Marcin Szamotulski wrote:
                > > 1) use map <cr> to find out whether the mapping already
                > > >exist when you run the code.
                > I got "no mapping found"
                > > >2) lookup how the the Voom plugin does map <CR> to a key.
                > > >There is no python magic - all mappings are done in Vim - so you're
                > > >likely to be wrong about assuming its related to python.
                > I agree now that I'm wrong on that.
                > so I got these from the plugin code:
                >
                > " Which key to map to Select-Node-and-Shuttle-between-Body/Tree
                > if !exists('g:voom_return_key')
                > let g:voom_return_key = '<Return>'
                > endif
                >
                > ......
                >
                > exe "nnoremap <buffer><silent> ".g:voom_return_key." :<C-u>call
                > Voom_TreeSelect(0)<CR>"
                > exe "vnoremap <buffer><silent> ".g:voom_return_key." <Esc>:<C-u>call
                > Voom_TreeSelect(0)<CR>"
                > "exe "vnoremap <buffer><silent> ".g:voom_return_key." <Nop>"
                > exe "nnoremap <buffer><silent> ".g:voom_tab_key." :<C-u>call
                > Voom_ToTreeOrBodyWin()<CR>"
                > exe "vnoremap <buffer><silent> ".g:voom_tab_key." <Esc>:<C-u>call
                > Voom_ToTreeOrBodyWin()<CR>"
                > "exe "vnoremap <buffer><silent> ".g:voom_tab_key." <Nop>"
                >
                > > >
                > > >grep the plugin code for CR and cr and you'll be lucky. Then try using
                > > >the right hand side instead of sendig <cr> - you may get more helpful
                > > >error messages then.
                > this is a bit complex kind of map... so based on that , how can I make a
                > jump within my script?
                > I tried:
                > exec "<C-u>call Voom_TreeSelect(0)<CR>"
                >
                > it seems not work:
                >
                > Error detected while processing function QuitNR:
                > line 11:
                > E488: Trailing characters: <C-u>call Voom_TreeSelect(0)<CR>
                > Press ENTER or type command to continue
                >
                >
                > thanks.
                To call a function it is enough to write:

                call VoomTreeSelect(0)

                in you vimscript. However if you want to use :execute command (but you
                don't need to):

                exe 'call VoomTreeSelect(0)'

                Both <c-u> and <cr> are not needed. An example of a usage of <c-u> and
                <cr> is when you define a map via :exe :

                exe 'map E :<C-U>call VoomTreeSelect(0)<CR>'

                and I presume you took your syntax from here. The difference is that
                the right hand side of a map is not the same as what exe statement is
                using. :exe executes expressions as an Ex command while the right hand
                side of a map is a bunch of normal commands, where ':' is used to enter
                the command line. If you enter it in the visual mode, then it will
                start with range '<,>' and <c-u> is used to delete it.

                Best,
                Marcin

                --
                --
                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 vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Marc Weber
                ... Let s you overide the key. ... THis means fill in the setting defined above. Thus its basically: nnoremap : call
                Message 7 of 15 , Feb 7, 2013
                • 0 Attachment
                  > if !exists('g:voom_return_key')
                  > let g:voom_return_key = '<Return>'
                  > endif

                  Let's you overide the <CR> key.

                  > exe "nnoremap <buffer><silent> ".g:voom_return_key." :<C-u>call Voom_TreeSelect(0)<CR>"
                  THis means fill in the setting defined above. Thus its basically:

                  nnoremap <buffer><silent> <CR> :<c-u>call Voom_TreeSelect(0)

                  You only want what vim call the RHS (righthandside): call Voom_TreeSelect(...)
                  Use that instead of normal "<cr>"

                  At least you should have enough info now to find a way to succeed.

                  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

                  ---
                  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 vim_use+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • ping
                  ... thanks for all of those good info, it s really nice to learn. I ve saved these notes and later references also. now with this: call Voom_ToTreeOrBodyWin()
                  Message 8 of 15 , Feb 7, 2013
                  • 0 Attachment
                    On 2/7/2013 7:08 AM, Marc Weber wrote:
                    >> if !exists('g:voom_return_key')
                    >> let g:voom_return_key = '<Return>'
                    >> endif
                    > Let's you overide the <CR> key.
                    >
                    >> exe "nnoremap <buffer><silent> ".g:voom_return_key." :<C-u>call Voom_TreeSelect(0)<CR>"
                    > THis means fill in the setting defined above. Thus its basically:
                    >
                    > nnoremap <buffer><silent> <CR> :<c-u>call Voom_TreeSelect(0)
                    >
                    > You only want what vim call the RHS (righthandside): call Voom_TreeSelect(...)
                    > Use that instead of normal "<cr>"
                    >
                    > At least you should have enough info now to find a way to succeed.
                    >
                    > Marc Weber
                    >
                    thanks for all of those good info, it's really nice to learn.
                    I've saved these notes and later references also.

                    now with this:
                    call Voom_ToTreeOrBodyWin()

                    in my script:
                    function! QuitNR()
                    "get number of one win in voom
                    let wn_curr=winnr()

                    "normal <CR>
                    call Voom_ToTreeOrBodyWin()

                    let wn_pair=winnr()
                    let wn_larger=wn_curr > wn_pair ? wn_curr : wn_pair
                    let wn_smaller=wn_curr < wn_pair ? wn_curr : wn_pair

                    "jump larger win first
                    exec wn_larger . "wincmd w"
                    "close the win
                    close
                    "then jump to the smaller win and close it out
                    exec wn_smaller . "wincmd w"
                    close
                    endfu
                    nn vV :call QuitNR()<CR>

                    I succeed!

                    thanks for all the helps and good notes! you guys make this alias
                    extremely helpful...



                    regards
                    ping


                    --
                    --
                    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 vim_use+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Benji Fisher
                    Maybe this is too little, too late, but your syntax was wrong. If you want to emulate hitting Enter, then the right way is ... (and scroll down to the
                    Message 9 of 15 , Feb 7, 2013
                    • 0 Attachment
                      Maybe this is too little, too late, but your syntax was wrong.  If you want to emulate hitting Enter, then the right way is

                      :execute "normal \<CR>"

                      :help :normal

                      (and scroll down to the example).

                      -- 
                      HTH
                      Benji Fisher


                      On Thu, Feb 7, 2013 at 9:21 AM, ping <songpingemail@...> wrote:
                      On 2/7/2013 7:08 AM, Marc Weber wrote:
                         if !exists('g:voom_return_key')
                             let g:voom_return_key = '<Return>'
                         endif
                      Let's you overide the <CR> key.
                       
                      exe "nnoremap <buffer><silent> ".g:voom_return_key." :<C-u>call Voom_TreeSelect(0)<CR>"
                      THis means fill in the setting defined above. Thus its basically:

                      nnoremap <buffer><silent> <CR> :<c-u>call Voom_TreeSelect(0)

                      You only want what vim call the RHS (righthandside): call Voom_TreeSelect(...)
                      Use that instead of normal "<cr>"

                      At least you should have enough info now to find a way to succeed.

                      Marc Weber

                      thanks for all of those good info, it's really nice to learn.
                      I've saved these notes and later references also.

                      now with this:
                      call Voom_ToTreeOrBodyWin()

                      in my script:
                      function! QuitNR()
                          "get number of one win in voom
                          let wn_curr=winnr()

                          "normal <CR>
                          call Voom_ToTreeOrBodyWin()


                          let wn_pair=winnr()
                          let wn_larger=wn_curr > wn_pair ? wn_curr : wn_pair
                          let wn_smaller=wn_curr < wn_pair ? wn_curr : wn_pair

                          "jump larger win first

                          exec wn_larger . "wincmd w"
                          "close the win
                          close
                          "then jump to the smaller win and close it out

                          exec wn_smaller . "wincmd w"
                          close
                      endfu
                      nn vV :call QuitNR()<CR>

                      I succeed!

                      thanks for all the helps and good notes! you guys make this alias extremely helpful...



                      regards
                      ping



                      --
                      --
                      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 vim_use+unsubscribe@googlegroups.com.
                      For more options, visit https://groups.google.com/groups/opt_out.



                      --
                      --
                      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 vim_use+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                       
                       
                    • ping
                      ... ohhh...this looks a more generic solution... it works perfectly in all cases! thanks! -- -- You received this message from the vim_use maillist. Do not
                      Message 10 of 15 , Feb 7, 2013
                      • 0 Attachment
                        On 2/7/2013 1:47 PM, Benji Fisher wrote:
                        > Maybe this is too little, too late, but your syntax was wrong. If you
                        > want to emulate hitting Enter, then the right way is
                        >
                        > :execute "normal \<CR>"
                        >
                        > :help :normal
                        ohhh...this looks a more generic solution...
                        it works perfectly in all cases! 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

                        ---
                        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 vim_use+unsubscribe@....
                        For more options, visit https://groups.google.com/groups/opt_out.
                      • Vlad Irnov
                        ... Hi Ping, Please use the github page or email me directly for any VOoM-specific requests. Scripting of VOoM should not be attempted without my supervision!
                        Message 11 of 15 , Feb 7, 2013
                        • 0 Attachment
                          On 2/7/13, ping <songpingemail@...> wrote:
                          > On 2/7/2013 7:08 AM, Marc Weber wrote:
                          >>> if !exists('g:voom_return_key')
                          >>> let g:voom_return_key = '<Return>'
                          >>> endif
                          >> Let's you overide the <CR> key.
                          >>
                          >>> exe "nnoremap <buffer><silent> ".g:voom_return_key." :<C-u>call
                          >>> Voom_TreeSelect(0)<CR>"
                          >> THis means fill in the setting defined above. Thus its basically:
                          >>
                          >> nnoremap <buffer><silent> <CR> :<c-u>call Voom_TreeSelect(0)
                          >>
                          >> You only want what vim call the RHS (righthandside): call
                          >> Voom_TreeSelect(...)
                          >> Use that instead of normal "<cr>"
                          >>
                          >> At least you should have enough info now to find a way to succeed.
                          >>
                          >> Marc Weber
                          >>
                          > thanks for all of those good info, it's really nice to learn.
                          > I've saved these notes and later references also.
                          >
                          > now with this:
                          > call Voom_ToTreeOrBodyWin()
                          >
                          > in my script:
                          > function! QuitNR()
                          > "get number of one win in voom
                          > let wn_curr=winnr()
                          >
                          > "normal <CR>
                          > call Voom_ToTreeOrBodyWin()
                          >
                          > let wn_pair=winnr()
                          > let wn_larger=wn_curr > wn_pair ? wn_curr : wn_pair
                          > let wn_smaller=wn_curr < wn_pair ? wn_curr : wn_pair
                          >
                          > "jump larger win first
                          > exec wn_larger . "wincmd w"
                          > "close the win
                          > close
                          > "then jump to the smaller win and close it out
                          > exec wn_smaller . "wincmd w"
                          > close
                          > endfu
                          > nn vV :call QuitNR()<CR>
                          >
                          > I succeed!
                          >
                          > thanks for all the helps and good notes! you guys make this alias
                          > extremely helpful...

                          Hi Ping,

                          Please use the github page or email me directly for any VOoM-specific
                          requests.

                          Scripting of VOoM should not be attempted without my supervision! All
                          plugin functions are global because this is how I like it, but you
                          cannot just call any function from any buffer.

                          Closing windows one by one is a bit complicated. There is utility
                          function Voom_DeleteOutline([command]) which you can use to
                          simultaneously close the current window and to delete the associated
                          Tree buffer, if any. See VOoM help for details, section
                          |voom_quit|. In your case, define a global mapping like this:
                          :nnoremap <silent> vV :call Voom_DeleteOutline('close')<CR>
                          Then you can get rid of both the source window and the associated Tree
                          buffer with at most two commands: move to the source window (<Cr> or
                          <Tab>) and press "vV". Instead of 'close' you can specify 'bd' or 'bw'
                          or 'q'.

                          Regards, Vlad

                          --
                          --
                          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 vim_use+unsubscribe@....
                          For more options, visit https://groups.google.com/groups/opt_out.
                        • ping
                          ... thanks Vlad, that s definitely more neat way. but what if I want to archive the same effect regardless of which window my cursor is currently is, body or
                          Message 12 of 15 , Feb 7, 2013
                          • 0 Attachment
                            On 2/7/2013 8:10 PM, Vlad Irnov wrote:
                            |voom_quit|. In your case, define a global mapping like this:
                                :nnoremap <silent> vV :call Voom_DeleteOutline('close')<CR>
                            Then you can get rid of both the source window and the associated Tree
                            buffer with at most two commands: move to the source window (<Cr> or
                            <Tab>) and press "vV". Instead of 'close' you can specify 'bd' or 'bw'
                            or 'q'.
                            thanks Vlad, that's definitely more neat way.
                            but what if I want to archive the same effect regardless of which window my cursor is currently is, body or tree?
                            I did a quick test, and it looks as you pointed out I need to move my cursor in the body and invoke the Voom_DeleteOutline() function.
                            the reason I wanted the "jump"-and-"record the winnr" method is to make sure I got the same result regardless of my positon (body or tree).

                            b.t.w, it may looks a stupid desire that why I need this, the real driver is that I'm using nrrw over Voom. so very frequently I need to invoke a new
                            nrrwrgn over the VOom-ed buffer, highlight/outline it with voom again (now I have 2 pairs of Voom-ed buffer --- 4 windows),
                            and I need to close the 2 new windows after that quick work done.

                            regards
                            ping
                             


                            --
                            --
                            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 vim_use+unsubscribe@....
                            For more options, visit https://groups.google.com/groups/opt_out.
                             
                             
                          Your message has been successfully submitted and would be delivered to recipients shortly.