hi chris: this works! thanks! regards ping ... -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you
Message 1 of 25
, May 31, 2012
On May 31, 1:21 am, "Christian Brabandt" <cbli...@...> wrote:
> On Wed, May 30, 2012 20:17, ping wrote:
> > hi Christan:
> > yes that works!
> > thanks!
> > previously I got it wrong that I visually selected my text and apply
> > the function with that range.
> > b.t.w can we actually achieve that goal based on your function here?
> I think, this should do:
> function! CopyNonFolded() range
> let lnum= a:firstline
> let buffer=
> while lnum <= a:lastline
> if (foldclosed(lnum) == -1)
> let buffer += getline(lnum, lnum)
> let lnum += 1
> let buffer += [ foldtextresult(lnum) ]
> let lnum = foldclosedend(lnum) + 1
> top new
> set bt=nofile
> call append(".",buffer)
> com! -range=% CopyFolds :<line1>,<line2>call CopyNonFolded()
> You can then use the command Copyfolds with or without a selected range
> (in which case it selects the complete file).
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.
Changes have not been saved
Press OK to abandon changes or Cancel to continue editing
Your browser is not supported
Kindly note that Groups does not support 7.0 or earlier versions of Internet Explorer.
We recommend upgrading to the latest Internet Explorer, Google Chrome, or Firefox. If you are using IE 9 or later, make sure you turn off Compatibility View.