/vim-foldpeek

Peek in fold

Primary LanguageVim ScriptMIT LicenseMIT

vim-foldpeek

vim-foldpeek starts from a partial fork of LeafCage/foldCC.vim. Thanks!

Installation

Install the plugin using your favorite package manager.

For dein.vim

call dein#add('kaile256/vim-foldpeek')

Features

  • You can peek another line, skipping lines which have few information.

    Set some skip-patterns in g:foldpeek#skip_patterns or b:foldpeek_skip_patterns.
    The default value is '^[\-=/{!* \t]*$' in list. Values will be compared to each folded line in regexp match. Customize it like below:

  " '```.*$' for markdown,  '[# \t]*\[\[plugins]]' for dein users
  let g:foldpeek#skip_patterns = [
        \ '^[\-=/{!* \t]*$',
        \ '^```.*$'
        \ '[# \t]*\[\[plugins]]',
        \ ]
  • As default, you will get the number of folded lines at tail.

    Addition to that, when each of numbers are 2 or more, you can get the number of foldlevel at head and the number of peeked line as the top of folded lines is 1.

with foldpeek#text() (in vim-foldpeek)
tarai_peek
with foldtext() (default)
tarai_text

For more detail, type :h foldpeek in vim's command line and see doc/foldpeek.txt.

TODO

  • Adjust width for unicode character

License

MIT