One of the nice things about Vim is that one can insert a page feed symbol (Ctrl–L in Insert mode), which delegates the printer to start printing the following on a new page. It shows as ^L in text.
Is it possible to make this symbol show as something else, for example as
----------------- new page here -----------------
so it is somewhat more visible while scrolling through pages of text?
That is, without rebuilding Vim from source.
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
foldexproption, it is possible to increase the fold levelof the lines that contain page feed symbol. (Herein, for the sake of
efficiency of evaluating
foldexpr, I assume that page feed symbolsare 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.
Resulting separators appear as the text
--- new pagefollowed bya continuing string of filling characters to the right of the window
(see
:help fillchars, under thefold:item).