On Tue, Jan 19, 2010 at 8:01 PM, Benjamin R. Haskell <[email protected]> wrote:
> Using this following minimal example, with foldmethod=marker:
>
> $ cat foldtest.txt
> {{{
> }}}
>
> If I close the fold on the last character of a line, 'l' will not open
> the fold.

This is by design, l only opens the fold if the cursor moves within
the fold, and l doesn't move the cursor when it's already at EOL.

> It's actually more annoying with foldmethod=syntax, with
> closing braces in column 1:
>
> $ cat foldtest.c
> void f() {
> }
> void g() {
> }
>
> I tried setting fdo=all, but that seems to open folds if I even look in
> their direction.  (And prevents manually closing folds if the cursor's
> in them).  Adding 'insert' and 'jump' didn't seem to make a difference
> either.
>
> Is there some way to get the auto-opening via 'l'-motion that I'm
> looking for?  I much prefer simply 'l'-ing into the fold as I'm browsing
> the file, rather than typing 'zo'.

Well, if it's only l and h you want, this should do the trick:

    :nnoremap l zvl
    :nnoremap h zvh

zv unfolds as much as necessary to make the line containing the cursor
be completely unfolded.

~Matt
-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to