If you do not use folding extensively when editing those files
containing page feed symbols, you can use one-line folds to mark
them out.
Using the foldexpr
option, it is possible to increase the fold level
of the lines that contain page feed symbol. (Herein, for the sake of
efficiency of evaluating foldexpr
, I assume that page feed symbols
are always the first characters on their lines.) To achieve the
desired effect of a screen-wide separator, these folds can be made
auto-closable.
The following function configures folding according to the idea
described above. Call it (manually or by means of an autocommand)
to enable page feed symbol folding in the current buffer.
function! FoldPageFeed()
setl foldmethod=expr
setl foldexpr=getline(v:lnum)[0]==\"\\<c-l>\"
setl foldminlines=0
setl foldtext='---\ new\ page\ '
setl foldlevel=0
set foldclose=all
endfunction
Resulting separators appear as the text --- new page
followed by
a continuing string of filling characters to the right of the window
(see :help fillchars
, under the fold:
item).