Diagonal slash marks

Sometimes, instead of a note or notes,
a diagonal slash mark is printed on a staff.
This is used for various purposes,
such as strumming a chord (in a
guitar part), or to mean that the previous beat should be
repeated or
that a note should be improvised.
You can get slash marks for all notes by setting the
noteheads parameter.

noteheads = "allslash"

or if you want to use hollow slashes for half notes and longer

noteheads = "slash"

Usually such slash marks do not include a stem,
so you may wish to also set

stemlen=0

If you just want specific chords to be slashes, you can use the
chord head shape override: