Skip to content

Fold more and fold less not working like built-in #260

Description

@csss1234
## header
- block
	- note

when carat is on "block" line, (already folded), and i go to menu > fold more, it will collapse the header, because that is "more" folding. but with vim, it requires moving the carat up to the header. it will succesfully fold the "note" into the "block", but pushing it a second time wont then fold the header. any way to get it to function like the built-in "fold more"?

my code

" Toggle current fold
exmap togglefold obcommand editor:toggle-fold
nmap zo :togglefold<CR>

" Unfold all sections
exmap unfoldall obcommand editor:unfold-all
nmap zR :unfoldall<CR>

" Fold less (i.e. unfold one level)
exmap foldreduce obcommand editor:fold-less
nmap zr :foldreduce<CR>

" Fold all sections
exmap foldall obcommand editor:fold-all
nmap zM :foldall<CR>

" Fold more (i.e. collapse one additional header level)
exmap foldmore obcommand editor:fold-more
nmap zm :foldmore<CR>

" Map arrow keys to incremental folding:
" Left arrow: fold more (collapse further)
" Right arrow: fold less (expand one level)
nmap <Left>  :foldmore<CR>
nmap <Right> :foldreduce<CR>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions