Thursday, March 14, 2013

Re: vim : fold expansion and refresh

On 07/12/2012 05:31 PM, Andy Wokula wrote:
> Am 12.07.2012 22:55, schrieb sc:
>> On Thu, Jul 12, 2012 at 04:22:29PM -0400, ping wrote:
>>> guys:
>>
>>> everytime I expand the fold , I notice the text got a little bit
>>> messed up somewhere, c-l quickly clean it nicely.
>>> so if I map "l" as following:
>>> :map l zo<C-l>
>>> it works fine, except I can't use its normal function (move right).
>>> how to solve this issue?
>>> my guess there should be a small script/function that check if this
>>> is on a folded text ,
>>> but my vimL ability doesn't allow me to make it concrete.
>>> any help I can get ?
>>
>> see :help foldclosed()
>
> for example
>
> :nn <expr> l foldclosed(".")>=1 ? "zo<C-L>" : "l"
>

finally I solved the issue via this (stupid but working) configs.
thanks!

nn <expr> l foldclosed(".")>=1 ? "zo<C-L>" : "l"
nn <expr> 0 foldclosed(".")>=1 ? "zo<C-L>" : "0"
nn zo zo<C-L>
nn zO zO<C-L>
nn zc zc<C-L>
nn zC zC<C-L>
nn za za<C-L>
nn zA zA<C-L>
nn zx zxzc<C-L>
nn zX zX<C-L>
nn zm zm<C-L>
nn zM zM<C-L>
nn zr zr<C-L>
nn zR zR<C-L>
nn zi zi<C-L>

--
--
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.

No comments: