Thursday, February 7, 2013

Re: vim: help for scripting

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
 


No comments: